From 4b859cfff9965eb07044f4d104398cb0e7ab127e Mon Sep 17 00:00:00 2001 From: Jon Atack Date: Sun, 31 May 2020 18:03:47 +0200 Subject: cli: add multiwallet capability to GetNewAddress and -generate --- src/bitcoin-cli.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/bitcoin-cli.cpp') diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 09a436e116..f5125f22db 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -538,8 +538,10 @@ static void GetWalletBalances(UniValue& result) */ static UniValue GetNewAddress() { + Optional wallet_name{}; + if (gArgs.IsArgSet("-rpcwallet")) wallet_name = gArgs.GetArg("-rpcwallet", ""); std::unique_ptr rh{MakeUnique()}; - return ConnectAndCallRPC(rh.get(), "getnewaddress", /* args=*/{}); + return ConnectAndCallRPC(rh.get(), "getnewaddress", /* args=*/{}, wallet_name); } /** -- cgit v1.2.3