Skip to content

Commit 4b859cf

Browse files
committed
cli: add multiwallet capability to GetNewAddress and -generate
1 parent 18f9354 commit 4b859cf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/bitcoin-cli.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,8 +538,10 @@ static void GetWalletBalances(UniValue& result)
538538
*/
539539
static UniValue GetNewAddress()
540540
{
541+
Optional<std::string> wallet_name{};
542+
if (gArgs.IsArgSet("-rpcwallet")) wallet_name = gArgs.GetArg("-rpcwallet", "");
541543
std::unique_ptr<BaseRequestHandler> rh{MakeUnique<DefaultRequestHandler>()};
542-
return ConnectAndCallRPC(rh.get(), "getnewaddress", /* args=*/{});
544+
return ConnectAndCallRPC(rh.get(), "getnewaddress", /* args=*/{}, wallet_name);
543545
}
544546

545547
/**

0 commit comments

Comments
 (0)