Changeset View
Changeset View
Standalone View
Standalone View
src/bitcoin-cli.cpp
Show First 20 Lines • Show All 953 Lines • ▼ Show 20 Lines | static void GetWalletBalances(UniValue &result) { | ||||
result.pushKV("balances", balances); | result.pushKV("balances", balances); | ||||
} | } | ||||
/** | /** | ||||
* Call RPC getnewaddress. | * Call RPC getnewaddress. | ||||
* @returns getnewaddress response as a UniValue object. | * @returns getnewaddress response as a UniValue object. | ||||
*/ | */ | ||||
static UniValue GetNewAddress() { | static UniValue GetNewAddress() { | ||||
std::optional<std::string> wallet_name{}; | |||||
if (gArgs.IsArgSet("-rpcwallet")) { | |||||
wallet_name = gArgs.GetArg("-rpcwallet", ""); | |||||
} | |||||
std::unique_ptr<BaseRequestHandler> rh{ | std::unique_ptr<BaseRequestHandler> rh{ | ||||
std::make_unique<DefaultRequestHandler>()}; | std::make_unique<DefaultRequestHandler>()}; | ||||
return ConnectAndCallRPC(rh.get(), "getnewaddress", /* args=*/{}); | return ConnectAndCallRPC(rh.get(), "getnewaddress", /* args=*/{}, | ||||
wallet_name); | |||||
} | } | ||||
/** | /** | ||||
* Check bounds and set up args for RPC generatetoaddress params: nblocks, | * Check bounds and set up args for RPC generatetoaddress params: nblocks, | ||||
* address, maxtries. | * address, maxtries. | ||||
* @param[in] address Reference to const string address to insert into the | * @param[in] address Reference to const string address to insert into the | ||||
* args. | * args. | ||||
* @param args Reference to vector of string args to modify. | * @param args Reference to vector of string args to modify. | ||||
▲ Show 20 Lines • Show All 175 Lines • Show Last 20 Lines |