Fix diff return inside of getblockchaininfo
@@ -663,22 +663,26 @@ Value getblockchaininfo(const Array& params, bool fHelp)
" \"initialblockdownload\": xxxx, (bool) estimate of whether this D node is in Initial Block Download mode.\n"
//" \"verificationprogress\": xxxx, (numeric) estimate of verification progress [0..1]\n"
//" \"chainwork\": \"xxxx\" (string) total amount of work in active chain, in hexadecimal\n"
+ " \"moneysupply\": xxxx, (numeric) the current supply of D in circulation\n"
"}\n"
);
proxyType proxy;
GetProxy(NET_IPV4, proxy);
- Object obj;
+ Object obj, diff;
std::string chain = "testnet";
if(!fTestNet)
chain = "main";
obj.push_back(Pair("chain", chain));
obj.push_back(Pair("blocks", (int)nBestHeight));
obj.push_back(Pair("bestblockhash", hashBestChain.GetHex()));
- obj.push_back(Pair("difficulty", (double)GetDifficulty()));
+ diff.push_back(Pair("proof-of-work", GetDifficulty()));
+ diff.push_back(Pair("proof-of-stake", GetDifficulty(GetLastBlockIndex(pindexBest, true))));
+ obj.push_back(Pair("difficulty", diff));
obj.push_back(Pair("initialblockdownload", IsInitialBlockDownload()));
//obj.push_back(Pair("verificationprogress", Checkpoints::GuessVerificationProgress(hashBestChain)));
//obj.push_back(Pair("chainwork", hashBestChain->nChainWork.GetHex()));
+ obj.push_back(Pair("moneysupply", ValueFromAmount(pindexBest->nMoneySupply)));
return obj;
}
\ No newline at end of file
