@@ -357,7 +357,7 @@ class GetinfoRequestHandler: public BaseRequestHandler
357
357
connections.pushKV (" mn_total" , batch[ID_NETWORKINFO][" result" ][" connections_mn" ]);
358
358
result.pushKV (" connections" , connections);
359
359
360
- result.pushKV (" proxy " , batch[ID_NETWORKINFO][" result" ][" networks" ][ 0 ][ " proxy " ]);
360
+ result.pushKV (" networks " , batch[ID_NETWORKINFO][" result" ][" networks" ]);
361
361
result.pushKV (" difficulty" , batch[ID_BLOCKCHAININFO][" result" ][" difficulty" ]);
362
362
result.pushKV (" chain" , UniValue (batch[ID_BLOCKCHAININFO][" result" ][" chain" ]));
363
363
if (!batch[ID_WALLETINFO][" result" ].isNull ()) {
@@ -981,8 +981,26 @@ static void ParseGetInfoResult(UniValue& result)
981
981
RESET);
982
982
result_string += strprintf (" Version: %s\n " , result[" version" ].getValStr ());
983
983
result_string += strprintf (" Time offset (s): %s\n " , result[" timeoffset" ].getValStr ());
984
- const std::string proxy = result[" proxy" ].getValStr ();
985
- result_string += strprintf (" Proxy: %s\n " , proxy.empty () ? " N/A" : proxy);
984
+
985
+ // proxies
986
+ std::map<std::string, std::vector<std::string>> proxy_networks;
987
+ std::vector<std::string> ordered_proxies;
988
+
989
+ for (const UniValue& network : result[" networks" ].getValues ()) {
990
+ const std::string proxy = network[" proxy" ].getValStr ();
991
+ if (proxy.empty ()) continue ;
992
+ // Add proxy to ordered_proxy if has not been processed
993
+ if (proxy_networks.find (proxy) == proxy_networks.end ()) ordered_proxies.push_back (proxy);
994
+
995
+ proxy_networks[proxy].push_back (network[" name" ].getValStr ());
996
+ }
997
+
998
+ std::vector<std::string> formatted_proxies;
999
+ for (const std::string& proxy : ordered_proxies) {
1000
+ formatted_proxies.emplace_back (strprintf (" %s (%s)" , proxy, Join (proxy_networks.find (proxy)->second , " , " )));
1001
+ }
1002
+ result_string += strprintf (" Proxies: %s\n " , formatted_proxies.empty () ? " n/a" : Join (formatted_proxies, " , " ));
1003
+
986
1004
result_string += strprintf (" Min tx relay fee rate (%s/kB): %s\n\n " , CURRENCY_UNIT, result[" relayfee" ].getValStr ());
987
1005
988
1006
if (!result[" has_wallet" ].isNull ()) {
0 commit comments