RPC: show total balance in getwalletinfo
This commit is contained in:
@@ -51,15 +51,15 @@ UniValue getinfo(const UniValue& params, bool fHelp)
|
||||
" \"version\": xxxxx, (numeric) the server version\n"
|
||||
" \"protocolversion\": xxxxx, (numeric) the protocol version\n"
|
||||
" \"walletversion\": xxxxx, (numeric) the wallet version\n"
|
||||
" \"balance\": xxxxxxx, (numeric) the total bitcoin balance of the wallet\n"
|
||||
" \"balance\": xxxxxxx, (numeric) the total confirmed balance of the wallet\n"
|
||||
" \"blocks\": xxxxxx, (numeric) the current number of blocks processed in the server\n"
|
||||
" \"timeoffset\": xxxxx, (numeric) the time offset\n"
|
||||
" \"connections\": xxxxx, (numeric) the number of connections\n"
|
||||
" \"proxy\": \"host:port\", (string, optional) the proxy used by the server\n"
|
||||
" \"difficulty\": { (json object)\n"
|
||||
" \"proof-of-work\": xxxxxx, (numeric) the current proof-of-work difficulty\n"
|
||||
" \"proof-of-stake\": xxxxxx (numeric) the current proof-of-stake difficulty\n"
|
||||
" },\n"
|
||||
" \"difficulty\": { (json object)\n"
|
||||
" \"proof-of-work\": xxxxxx, (numeric) the current proof-of-work difficulty\n"
|
||||
" \"proof-of-stake\": xxxxxx (numeric) the current proof-of-stake difficulty\n"
|
||||
" },\n"
|
||||
" \"testnet\": true|false, (boolean) if the server is using testnet or not\n"
|
||||
" \"keypoololdest\": xxxxxx, (numeric) the timestamp (seconds since Unix epoch) of the oldest pre-generated key in the key pool\n"
|
||||
" \"keypoolsize\": xxxx, (numeric) how many new keys are pre-generated\n"
|
||||
|
||||
@@ -2265,8 +2265,9 @@ UniValue getwalletinfo(const UniValue& params, bool fHelp)
|
||||
"\nResult:\n"
|
||||
"{\n"
|
||||
" \"walletversion\": xxxxx, (numeric) the wallet version\n"
|
||||
" \"total_balance\": xxxxxxx, (numeric) the total balance of the wallet in " + CURRENCY_UNIT + "\n"
|
||||
" \"balance\": xxxxxxx, (numeric) the total confirmed balance of the wallet in " + CURRENCY_UNIT + "\n"
|
||||
" \"stake\": xxxxxx, (numeric) the total coins staked (non-spendable until maturity) in " + CURRENCY_UNIT + "\n"
|
||||
" \"staked_balance\": xxxxxx, (numeric) the total staked balance of the wallet in " + CURRENCY_UNIT + "\n"
|
||||
" \"unconfirmed_balance\": xxx, (numeric) the total unconfirmed balance of the wallet in " + CURRENCY_UNIT + "\n"
|
||||
" \"immature_balance\": xxxxxx, (numeric) the total immature balance of the wallet in " + CURRENCY_UNIT + "\n"
|
||||
" \"txcount\": xxxxxxx, (numeric) the total number of transactions in the wallet\n"
|
||||
@@ -2285,8 +2286,9 @@ UniValue getwalletinfo(const UniValue& params, bool fHelp)
|
||||
|
||||
UniValue obj(UniValue::VOBJ);
|
||||
obj.push_back(Pair("walletversion", pwalletMain->GetVersion()));
|
||||
obj.push_back(Pair("total_balance", ValueFromAmount(pwalletMain->GetBalance() + pwalletMain->GetUnconfirmedBalance() + pwalletMain->GetImmatureBalance() + pwalletMain->GetStake())));
|
||||
obj.push_back(Pair("balance", ValueFromAmount(pwalletMain->GetBalance())));
|
||||
obj.push_back(Pair("stake", ValueFromAmount(pwalletMain->GetStake())));
|
||||
obj.push_back(Pair("staked_balance", ValueFromAmount(pwalletMain->GetStake())));
|
||||
obj.push_back(Pair("unconfirmed_balance", ValueFromAmount(pwalletMain->GetUnconfirmedBalance())));
|
||||
obj.push_back(Pair("immature_balance", ValueFromAmount(pwalletMain->GetImmatureBalance())));
|
||||
obj.push_back(Pair("txcount", (int)pwalletMain->mapWallet.size()));
|
||||
|
||||
Reference in New Issue
Block a user