Changeset View
Changeset View
Standalone View
Standalone View
src/bitcoin-cli.cpp
Show First 20 Lines • Show All 878 Lines • ▼ Show 20 Lines | for (const UniValue &wallet : wallets.getValues()) { | ||||
rh.get(), "getbalances", /* args=*/{}, wallet_name); | rh.get(), "getbalances", /* args=*/{}, wallet_name); | ||||
const UniValue &balance = | const UniValue &balance = | ||||
find_value(getbalances, "result")["mine"]["trusted"]; | find_value(getbalances, "result")["mine"]["trusted"]; | ||||
balances.pushKV(wallet_name, balance); | balances.pushKV(wallet_name, balance); | ||||
} | } | ||||
result.pushKV("balances", balances); | result.pushKV("balances", balances); | ||||
} | } | ||||
/** | |||||
* Call RPC getnewaddress. | |||||
* @returns getnewaddress response as a UniValue object. | |||||
*/ | |||||
[[maybe_unused]] static UniValue GetNewAddress() { | |||||
std::unique_ptr<BaseRequestHandler> rh{ | |||||
std::make_unique<DefaultRequestHandler>()}; | |||||
return ConnectAndCallRPC(rh.get(), "getnewaddress", /* args=*/{}); | |||||
} | |||||
static int CommandLineRPC(int argc, char *argv[]) { | static int CommandLineRPC(int argc, char *argv[]) { | ||||
std::string strPrint; | std::string strPrint; | ||||
int nRet = 0; | int nRet = 0; | ||||
try { | try { | ||||
// Skip switches | // Skip switches | ||||
while (argc > 1 && IsSwitchChar(argv[1][0])) { | while (argc > 1 && IsSwitchChar(argv[1][0])) { | ||||
argc--; | argc--; | ||||
argv++; | argv++; | ||||
▲ Show 20 Lines • Show All 161 Lines • Show Last 20 Lines |