cli: add multiwallet capability to GetNewAddress and -generate

This commit is contained in:
Jon Atack 2020-05-31 18:03:47 +02:00
parent 18f93545a1
commit 4b859cfff9
No known key found for this signature in database
GPG key ID: 4F5721B3D0E3921D

View file

@ -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);
}
/**