X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Frpcmining.cpp;h=94d367147799af780115100a90e319143b70e294;hb=2c8f88fc67af7916670ce0086e6a9078df8182f0;hp=5d796faa32ca9e0b1f72c6b82b2cabba57646f3c;hpb=7e9ceb798f2685429f3387625beb872bbda1567c;p=novacoin.git diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index 5d796fa..94d3671 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -20,6 +20,9 @@ Value getmininginfo(const Array& params, bool fHelp) "getmininginfo\n" "Returns an object containing mining-related information."); + uint64 nMinWeight = 0, nMaxWeight = 0, nWeight = 0; + pwalletMain->GetStakeWeight(*pwalletMain, nMinWeight, nMaxWeight, nWeight); + Object obj; obj.push_back(Pair("blocks", (int)nBestHeight)); obj.push_back(Pair("currentblocksize",(uint64_t)nLastBlockSize)); @@ -30,9 +33,11 @@ Value getmininginfo(const Array& params, bool fHelp) obj.push_back(Pair("netstakeweight", GetPoSKernelPS())); obj.push_back(Pair("errors", GetWarnings("statusbar"))); obj.push_back(Pair("pooledtx", (uint64_t)mempool.size())); - obj.push_back(Pair("stakeweight", (uint64_t)pwalletMain->GetStakeWeight(*pwalletMain, STAKE_NORMAL))); - obj.push_back(Pair("minweight", (uint64_t)pwalletMain->GetStakeWeight(*pwalletMain, STAKE_MINWEIGHT))); - obj.push_back(Pair("maxweight", (uint64_t)pwalletMain->GetStakeWeight(*pwalletMain, STAKE_MAXWEIGHT))); + + obj.push_back(Pair("stakeweight", (uint64_t)nWeight)); + obj.push_back(Pair("minweight", (uint64_t)nMinWeight)); + obj.push_back(Pair("maxweight", (uint64_t)nMaxWeight)); + obj.push_back(Pair("stakeinterest", (uint64_t)GetProofOfStakeReward(0, GetLastBlockIndex(pindexBest, true)->nBits, GetLastBlockIndex(pindexBest, true)->nTime, true))); obj.push_back(Pair("testnet", fTestNet)); return obj;