aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoin-cli.cpp
diff options
context:
space:
mode:
authorJon Atack <[email protected]>2020-06-01 11:57:12 +0200
committerJon Atack <[email protected]>2020-06-02 08:24:29 +0200
commitf7c65a33508c4bb8e9ed896e150a4fa529a243e5 (patch)
tree40307d4d9a788a04f60c3dd23f33c38b11670819 /src/bitcoin-cli.cpp
parentrpc: make generatetoaddress locals const (diff)
downloaddiscoin-f7c65a33508c4bb8e9ed896e150a4fa529a243e5.tar.xz
discoin-f7c65a33508c4bb8e9ed896e150a4fa529a243e5.zip
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 8d85789b4..e959c4496 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;