aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoin-cli.cpp
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2020-06-01 11:57:12 +0200
committerJon Atack <jon@atack.com>2020-06-02 08:24:29 +0200
commitf7c65a33508c4bb8e9ed896e150a4fa529a243e5 (patch)
tree40307d4d9a788a04f60c3dd23f33c38b11670819 /src/bitcoin-cli.cpp
parent9be7fd35c5d631c2cc34d3b4fa63ae0a9d5a68ef (diff)
downloadbitcoin-f7c65a33508c4bb8e9ed896e150a4fa529a243e5.tar.xz
cli: create GetNewAddress()
Diffstat (limited to 'src/bitcoin-cli.cpp')
-rw-r--r--src/bitcoin-cli.cpp10
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;