Skip to content

Commit

Permalink
rpc: Add moneysupply and anonoutputs to getblockheader.
Browse files Browse the repository at this point in the history
  • Loading branch information
tecnovert committed Oct 31, 2019
1 parent 012beb1 commit 7a93655
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/release-notes-particl.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- Fixed crash when initaccountfromdevice is called before setting udev rules.
- Added udev rule hint to Qt gui if initaccountfromdevice fails.
- Creating a stealth address from the Qt gui works if the wallet was initialised with a hardware device.
- Added moneysupply and anonoutputs to getblockheader rpc output.


0.18.1.5
Expand Down
4 changes: 4 additions & 0 deletions src/rpc/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ UniValue blockheaderToJSON(const CBlockIndex* tip, const CBlockIndex* blockindex
result.pushKV("difficulty", GetDifficulty(blockindex));
result.pushKV("chainwork", blockindex->nChainWork.GetHex());
result.pushKV("nTx", (uint64_t)blockindex->nTx);
result.pushKV("moneysupply", ValueFromAmount(blockindex->nMoneySupply));
result.pushKV("anonoutputs", (uint64_t)blockindex->nAnonOutputs);

if (blockindex->pprev)
result.pushKV("previousblockhash", blockindex->pprev->GetBlockHash().GetHex());
Expand Down Expand Up @@ -766,6 +768,8 @@ static UniValue getblockheader(const JSONRPCRequest& request)
" \"difficulty\" : x.xxx, (numeric) The difficulty\n"
" \"chainwork\" : \"0000...1f3\" (string) Expected number of hashes required to produce the current chain (in hex)\n"
" \"nTx\" : n, (numeric) The number of transactions in the block.\n"
" \"moneysupply\": xxxxxxx, (numeric) the total amount of particl in the chain at this block\n"
" \"anonoutputs\": xxxxxxx, (numeric) the total amount of RCT outputs in the chain at this block\n"
" \"previousblockhash\" : \"hash\", (string) The hash of the previous block\n"
" \"nextblockhash\" : \"hash\", (string) The hash of the next block\n"
"}\n"
Expand Down

0 comments on commit 7a93655

Please sign in to comment.