diff options
author | Jon Atack <jon@atack.com> | 2020-06-01 11:57:12 +0200 |
---|---|---|
committer | Jon Atack <jon@atack.com> | 2020-06-02 08:24:29 +0200 |
commit | f7c65a33508c4bb8e9ed896e150a4fa529a243e5 (patch) | |
tree | 40307d4d9a788a04f60c3dd23f33c38b11670819 /src | |
parent | 9be7fd35c5d631c2cc34d3b4fa63ae0a9d5a68ef (diff) | |
download | bitcoin-f7c65a33508c4bb8e9ed896e150a4fa529a243e5.tar.xz |
cli: create GetNewAddress()
Diffstat (limited to 'src')
-rw-r--r-- | src/bitcoin-cli.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 8d85789b4e..e959c4496f 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -477,6 +477,16 @@ static void GetWalletBalances(UniValue& result) 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[]) { std::string strPrint; |