Skip to content

Commit f7c65a3

Browse files
committed
cli: create GetNewAddress()
1 parent 9be7fd3 commit f7c65a3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/bitcoin-cli.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,16 @@ static void GetWalletBalances(UniValue& result)
477477
result.pushKV("balances", balances);
478478
}
479479

480+
/**
481+
* Call RPC getnewaddress.
482+
* @returns getnewaddress response as a UniValue object.
483+
*/
484+
static UniValue GetNewAddress()
485+
{
486+
std::unique_ptr<BaseRequestHandler> rh{MakeUnique<DefaultRequestHandler>()};
487+
return ConnectAndCallRPC(rh.get(), "getnewaddress", /* args=*/{});
488+
}
489+
480490
static int CommandLineRPC(int argc, char *argv[])
481491
{
482492
std::string strPrint;

0 commit comments

Comments
 (0)