@@ -516,16 +516,16 @@ static void ParseError(const UniValue& error, std::string& strPrint, int& nRet)
516
516
*/
517
517
static void GetWalletBalances (UniValue& result)
518
518
{
519
- std::unique_ptr<BaseRequestHandler> rh{MakeUnique<DefaultRequestHandler>()} ;
520
- const UniValue listwallets = ConnectAndCallRPC (rh. get () , " listwallets" , /* args=*/ {});
519
+ DefaultRequestHandler rh;
520
+ const UniValue listwallets = ConnectAndCallRPC (&rh , " listwallets" , /* args=*/ {});
521
521
if (!find_value (listwallets, " error" ).isNull ()) return ;
522
522
const UniValue& wallets = find_value (listwallets, " result" );
523
523
if (wallets.size () <= 1 ) return ;
524
524
525
525
UniValue balances (UniValue::VOBJ);
526
526
for (const UniValue& wallet : wallets.getValues ()) {
527
527
const std::string wallet_name = wallet.get_str ();
528
- const UniValue getbalances = ConnectAndCallRPC (rh. get () , " getbalances" , /* args=*/ {}, wallet_name);
528
+ const UniValue getbalances = ConnectAndCallRPC (&rh , " getbalances" , /* args=*/ {}, wallet_name);
529
529
const UniValue& balance = find_value (getbalances, " result" )[" mine" ][" trusted" ];
530
530
balances.pushKV (wallet_name, balance);
531
531
}
@@ -540,8 +540,8 @@ static UniValue GetNewAddress()
540
540
{
541
541
Optional<std::string> wallet_name{};
542
542
if (gArgs .IsArgSet (" -rpcwallet" )) wallet_name = gArgs .GetArg (" -rpcwallet" , " " );
543
- std::unique_ptr<BaseRequestHandler> rh{MakeUnique<DefaultRequestHandler>()} ;
544
- return ConnectAndCallRPC (rh. get () , " getnewaddress" , /* args=*/ {}, wallet_name);
543
+ DefaultRequestHandler rh;
544
+ return ConnectAndCallRPC (&rh , " getnewaddress" , /* args=*/ {}, wallet_name);
545
545
}
546
546
547
547
/* *
0 commit comments