cli: create GetNewAddress()

This commit is contained in:
Jon Atack 2020-06-01 11:57:12 +02:00
parent 9be7fd35c5
commit f7c65a3350
No known key found for this signature in database
GPG Key ID: 4F5721B3D0E3921D

View File

@ -477,6 +477,16 @@ static void GetWalletBalances(UniValue& result)
result.pushKV("balances", balances); result.pushKV("balances", balances);
} }
/**
* Call RPC getnewaddress.
* @returns getnewaddress response as a UniValue object.
*/
static UniValue GetNewAddress()
{
std::unique_ptr<BaseRequestHandler> rh{MakeUnique<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;