#include "wallet.h"
#include "base58.h"
-#include "main.h"
-#include <math.h>
using namespace std;
return (GetAdjustedTime() - nTime) / 86400;
}
+uint64 KernelRecord::getCoinDay() const
+{
+ int64 nWeight = GetAdjustedTime() - nTime - nStakeMinAge;
+ if( nWeight < 0)
+ return 0;
+ nWeight = min(nWeight, (int64)nStakeMaxAge);
+ uint64 coinAge = (nValue * nWeight ) / (COIN * 86400);
+ return coinAge;
+}
+
int64 KernelRecord::getPoSReward(int nBits, int minutes)
{
double PoSReward;
std::string getTxID();
int64 getAge() const;
+ uint64 getCoinDay() const;
double getProbToMintStake(double difficulty, int timeOffset = 0) const;
double getProbToMintWithinNMinutes(double difficulty, int minutes);
int64 getPoSReward(int nBits, int timeOffset);
QString MintingTableModel::formatTxCoinDay(const KernelRecord *wtx) const
{
- return QString::number(wtx->coinAge);
+ return QString::number(wtx->getCoinDay());
}
QString MintingTableModel::formatTxAge(const KernelRecord *wtx) const