aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2020-05-31 18:03:47 +0200
committerJon Atack <jon@atack.com>2020-06-02 08:50:51 +0200
commit4b859cfff9965eb07044f4d104398cb0e7ab127e (patch)
tree9f2643678a86338065928255f719be8fbe519f52
parent18f93545a12db00180cea369a4b5cce7f10cd362 (diff)
cli: add multiwallet capability to GetNewAddress and -generate
-rw-r--r--src/bitcoin-cli.cpp4
1 files changed, 3 insertions, 1 deletions
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<std::string> wallet_name{};
+ if (gArgs.IsArgSet("-rpcwallet")) wallet_name = gArgs.GetArg("-rpcwallet", "");
std::unique_ptr<BaseRequestHandler> rh{MakeUnique<DefaultRequestHandler>()};
- return ConnectAndCallRPC(rh.get(), "getnewaddress", /* args=*/{});
+ return ConnectAndCallRPC(rh.get(), "getnewaddress", /* args=*/{}, wallet_name);
}
/**