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