Skip to content

Commit

Permalink
"getmoneysupply" added
Browse files Browse the repository at this point in the history
RPC command "getmoneysupply" has been added.
  • Loading branch information
zettel-kasten committed Apr 10, 2019
1 parent 61b243f commit 6e90879
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/bitcoinrpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ static const CRPCCommand vRPCCommands[] =
{ "listlockunspent", &listlockunspent, false, false, true },
{ "verifychain", &verifychain, true, false, false },
{ "getwordsalad", &getwordsalad, false, false, false },
{ "getmoneysupply", &getmoneysupply, true, false, false },
};

CRPCTable::CRPCTable()
Expand Down
1 change: 1 addition & 0 deletions src/bitcoinrpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,4 +212,5 @@ extern json_spirit::Value gettxout(const json_spirit::Array& params, bool fHelp)
extern json_spirit::Value verifychain(const json_spirit::Array& params, bool fHelp);

extern json_spirit::Value getwordsalad(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value getmoneysupply(const json_spirit::Array& params, bool fHelp);
#endif
11 changes: 11 additions & 0 deletions src/rpcwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1608,3 +1608,14 @@ Value listlockunspent(const Array& params, bool fHelp)
return ret;
}

Value getmoneysupply(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 0)
throw runtime_error(
"getmoneysupply\n"
"Returns total amount of coins in circulation.\n");

boost::int64_t moneysupply = GetTotalSupply();

return ValueFromAmount(moneysupply);
}

0 comments on commit 6e90879

Please sign in to comment.