diff options
| author | Jon Atack <[email protected]> | 2020-05-31 18:03:47 +0200 |
|---|---|---|
| committer | Jon Atack <[email protected]> | 2020-06-02 08:50:51 +0200 |
| commit | 4b859cfff9965eb07044f4d104398cb0e7ab127e (patch) | |
| tree | 9f2643678a86338065928255f719be8fbe519f52 /src/bitcoin-cli.cpp | |
| parent | test: add tests for bitcoin-cli -generate (diff) | |
| download | discoin-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.cpp | 4 |
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); } /** |