aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoin-cli.cpp
diff options
context:
space:
mode:
authorJon Atack <[email protected]>2020-05-31 18:03:47 +0200
committerJon Atack <[email protected]>2020-06-02 08:50:51 +0200
commit4b859cfff9965eb07044f4d104398cb0e7ab127e (patch)
tree9f2643678a86338065928255f719be8fbe519f52 /src/bitcoin-cli.cpp
parenttest: add tests for bitcoin-cli -generate (diff)
downloaddiscoin-4b859cfff9965eb07044f4d104398cb0e7ab127e.tar.xz
discoin-4b859cfff9965eb07044f4d104398cb0e7ab127e.zip
cli: add multiwallet capability to GetNewAddress and -generate
Diffstat (limited to 'src/bitcoin-cli.cpp')
-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 09a436e11..f5125f22d 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);
}
/**