X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fwallet.cpp;h=9cee9ef1ef75d66c9eed37d189586c44ca4f10ff;hb=ca01452ddf42045cc9032cb1d4bafc245ad8500b;hp=613edc29e15fbc7c344be116b0a7ac7ab5bb51fb;hpb=879527c9516e78bb51f2efe2ab9758f38bd40dae;p=novacoin.git diff --git a/src/wallet.cpp b/src/wallet.cpp index 613edc2..9cee9ef 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1376,11 +1376,16 @@ uint64 CWallet::GetStakeMintPower(const CKeyStore& keystore) if (pcoin.first->nTime + nStakeMaxAge > GetTime()) continue; - uint64 unCoinAge; - pcoin.first->GetCoinAge(txdb, unCoinAge); - nCoinAge += unCoinAge; + CBigNum bnCentSecond = CBigNum(pcoin.first->GetValueOut()) * (GetTime()-pcoin.first->nTime) / CENT; + CBigNum bnCoinDay = bnCentSecond * CENT / COIN / (24 * 60 * 60); + + + nCoinAge += bnCoinDay.getuint64(); } + if (fDebug && GetBoolArg("-printcoinage")) + printf("StakePower bnCoinDay=%"PRI64d"\n", nCoinAge); + return nCoinAge; }