Changeset View
Changeset View
Standalone View
Standalone View
src/bitcoin-cli.cpp
Show First 20 Lines • Show All 853 Lines • ▼ Show 20 Lines | |||||
/** | /** | ||||
* GetWalletBalances calls listwallets; if more than one wallet is loaded, it | * GetWalletBalances calls listwallets; if more than one wallet is loaded, it | ||||
* then fetches mine.trusted balances for each loaded wallet and pushes them to | * then fetches mine.trusted balances for each loaded wallet and pushes them to | ||||
* `result`. | * `result`. | ||||
* | * | ||||
* @param result Reference to UniValue object the wallet names and balances are | * @param result Reference to UniValue object the wallet names and balances are | ||||
* pushed to. | * pushed to. | ||||
*/ | */ | ||||
[[maybe_unused]] static void GetWalletBalances(UniValue &result) { | static void GetWalletBalances(UniValue &result) { | ||||
std::unique_ptr<BaseRequestHandler> rh{ | std::unique_ptr<BaseRequestHandler> rh{ | ||||
std::make_unique<DefaultRequestHandler>()}; | std::make_unique<DefaultRequestHandler>()}; | ||||
const UniValue listwallets = | const UniValue listwallets = | ||||
ConnectAndCallRPC(rh.get(), "listwallets", /* args=*/{}); | ConnectAndCallRPC(rh.get(), "listwallets", /* args=*/{}); | ||||
if (!find_value(listwallets, "error").isNull()) { | if (!find_value(listwallets, "error").isNull()) { | ||||
return; | return; | ||||
} | } | ||||
const UniValue &wallets = find_value(listwallets, "result"); | const UniValue &wallets = find_value(listwallets, "result"); | ||||
▲ Show 20 Lines • Show All 185 Lines • Show Last 20 Lines |