@@ -876,7 +876,7 @@ static UniValue ConnectAndCallRPC(BaseRequestHandler* rh, const std::string& str
876876 try {
877877 response = CallRPC (rh, strMethod, args, rpcwallet);
878878 if (fWait ) {
879- const UniValue& error = find_value (response, " error" );
879+ const UniValue& error = response. find_value (" error" );
880880 if (!error.isNull () && error[" code" ].getInt <int >() == RPC_IN_WARMUP) {
881881 throw CConnectionFailed (" server in warmup" );
882882 }
@@ -904,8 +904,8 @@ static void ParseResult(const UniValue& result, std::string& strPrint)
904904static void ParseError (const UniValue& error, std::string& strPrint, int & nRet)
905905{
906906 if (error.isObject ()) {
907- const UniValue& err_code = find_value (error, " code" );
908- const UniValue& err_msg = find_value (error, " message" );
907+ const UniValue& err_code = error. find_value (" code" );
908+ const UniValue& err_msg = error. find_value (" message" );
909909 if (!err_code.isNull ()) {
910910 strPrint = " error code: " + err_code.getValStr () + " \n " ;
911911 }
@@ -931,15 +931,15 @@ static void GetWalletBalances(UniValue& result)
931931{
932932 DefaultRequestHandler rh;
933933 const UniValue listwallets = ConnectAndCallRPC (&rh, " listwallets" , /* args=*/ {});
934- if (!find_value (listwallets, " error" ).isNull ()) return ;
935- const UniValue& wallets = find_value (listwallets, " result" );
934+ if (!listwallets. find_value (" error" ).isNull ()) return ;
935+ const UniValue& wallets = listwallets. find_value (" result" );
936936 if (wallets.size () <= 1 ) return ;
937937
938938 UniValue balances (UniValue::VOBJ);
939939 for (const UniValue& wallet : wallets.getValues ()) {
940940 const std::string wallet_name = wallet.get_str ();
941941 const UniValue getbalances = ConnectAndCallRPC (&rh, " getbalances" , /* args=*/ {}, wallet_name);
942- const UniValue& balance = find_value (getbalances, " result" )[" mine" ][" trusted" ];
942+ const UniValue& balance = getbalances. find_value (" result" )[" mine" ][" trusted" ];
943943 balances.pushKV (wallet_name, balance);
944944 }
945945 result.pushKV (" balances" , balances);
@@ -975,7 +975,7 @@ static void GetProgressBar(double progress, std::string& progress_bar)
975975 */
976976static void ParseGetInfoResult (UniValue& result)
977977{
978- if (!find_value (result, " error" ).isNull ()) return ;
978+ if (!result. find_value (" error" ).isNull ()) return ;
979979
980980 std::string RESET, GREEN, BLUE, YELLOW, MAGENTA, CYAN;
981981 bool should_colorize = false ;
@@ -1191,9 +1191,9 @@ static int CommandLineRPC(int argc, char *argv[])
11911191 rh.reset (new NetinfoRequestHandler ());
11921192 } else if (gArgs .GetBoolArg (" -generate" , false )) {
11931193 const UniValue getnewaddress{GetNewAddress ()};
1194- const UniValue& error{find_value (getnewaddress, " error" )};
1194+ const UniValue& error{getnewaddress. find_value (" error" )};
11951195 if (error.isNull ()) {
1196- SetGenerateToAddressArgs (find_value (getnewaddress, " result" ).get_str (), args);
1196+ SetGenerateToAddressArgs (getnewaddress. find_value (" result" ).get_str (), args);
11971197 rh.reset (new GenerateToAddressRequestHandler ());
11981198 } else {
11991199 ParseError (error, strPrint, nRet);
@@ -1215,8 +1215,8 @@ static int CommandLineRPC(int argc, char *argv[])
12151215 const UniValue reply = ConnectAndCallRPC (rh.get (), method, args, wallet_name);
12161216
12171217 // Parse reply
1218- UniValue result = find_value (reply, " result" );
1219- const UniValue& error = find_value (reply, " error" );
1218+ UniValue result = reply. find_value (" result" );
1219+ const UniValue& error = reply. find_value (" error" );
12201220 if (error.isNull ()) {
12211221 if (gArgs .GetBoolArg (" -getinfo" , false )) {
12221222 if (!gArgs .IsArgSet (" -rpcwallet" )) {
0 commit comments