return (GetAdjustedTime() - nTime) / 86400;
}
-double KernelRecord::getPoSReward(double difficulty, int minutes)
+int64 KernelRecord::getPoSReward(int nBits, int minutes)
{
double PoSReward;
- int nWeight = GetAdjustedTime() - nTime + minutes * 60;
+ int64 nWeight = GetAdjustedTime() - nTime + minutes * 60;
if( nWeight < nStakeMinAge)
return 0;
uint64 coinAge = (nValue * nWeight ) / (COIN * 86400);
- double nRewardCoinYear = floor(pow((0.03125 / difficulty), 1.0/3) *100)/100;
- nRewardCoinYear = min(nRewardCoinYear,1.0);
- PoSReward = (coinAge * nRewardCoinYear )/365;
- PoSReward = min(PoSReward,10.0);
+ PoSReward = GetProofOfStakeReward(coinAge, nBits, GetAdjustedTime() + minutes * 60);
return PoSReward;
}
int64 getAge() const;
double getProbToMintStake(double difficulty, int timeOffset = 0) const;
double getProbToMintWithinNMinutes(double difficulty, int minutes);
- double getPoSReward(double difficulty, int timeOffset);
+ int64 getPoSReward(int nBits, int timeOffset);
protected:
int prevMinutes;
double prevDifficulty;
<context>
<name>QObject</name>
<message>
- <source>from %1 NVC to %2 NVC</source>
- <translation>от %1 NVC до %2 NVC</translation>
+ <source>from %1 to %2</source>
+ <translation>от %1 до %2</translation>
</message>
<message>
<source>%1 d</source>
QString MintingTableModel::formatTxPoSReward(KernelRecord *wtx) const
{
QString posReward;
- const CBlockIndex *p = GetLastBlockIndex(pindexBest, true);
- double difficulty = GetDifficulty(p);
- posReward += QString(QObject::tr("from %1 NVC to %2 NVC")).arg(QString::number(wtx->getPoSReward(difficulty, 0),'f', 6),
- QString::number(wtx->getPoSReward(difficulty, mintingInterval),'f', 6));
+ int nBits = GetLastBlockIndex(pindexBest, true)->nBits;
+ posReward += QString(QObject::tr("from %1 to %2")).arg(BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, wtx->getPoSReward(nBits, 0)),
+ BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, wtx->getPoSReward(nBits, mintingInterval)));
return posReward;
}
return QModelIndex();
}
}
-