@@ -82,6 +82,10 @@ static UniValue getpeerinfo(const JSONRPCRequest& request)
8282 " \" addrbind\" :\" ip:port\" , (string) Bind address of the connection to the peer\n "
8383 " \" addrlocal\" :\" ip:port\" , (string) Local address as reported by the peer\n "
8484 " \" services\" :\" xxxxxxxxxxxxxxxx\" , (string) The services offered\n "
85+ " \" servicesnames\" :[ (array) the services offered, in human-readable form\n "
86+ " \" SERVICE_NAME\" , (string) the service name if it is recognised\n "
87+ " ...\n "
88+ " ],\n "
8589 " \" relaytxes\" :true|false, (boolean) Whether peer has asked us to relay transactions to it\n "
8690 " \" lastsend\" : ttt, (numeric) The time in seconds since epoch (Jan 1 1970 GMT) of the last send\n "
8791 " \" lastrecv\" : ttt, (numeric) The time in seconds since epoch (Jan 1 1970 GMT) of the last receive\n "
@@ -147,6 +151,7 @@ static UniValue getpeerinfo(const JSONRPCRequest& request)
147151 if (stats.addrBind .IsValid ())
148152 obj.pushKV (" addrbind" , stats.addrBind .ToString ());
149153 obj.pushKV (" services" , strprintf (" %016x" , stats.nServices ));
154+ obj.pushKV (" servicesnames" , GetServicesNames (stats.nServices ));
150155 obj.pushKV (" relaytxes" , stats.fRelayTxes );
151156 obj.pushKV (" lastsend" , stats.nLastSend );
152157 obj.pushKV (" lastrecv" , stats.nLastRecv );
@@ -446,6 +451,10 @@ static UniValue getnetworkinfo(const JSONRPCRequest& request)
446451 " \" subversion\" : \" /Satoshi:x.x.x/\" , (string) the server subversion string\n "
447452 " \" protocolversion\" : xxxxx, (numeric) the protocol version\n "
448453 " \" localservices\" : \" xxxxxxxxxxxxxxxx\" , (string) the services we offer to the network\n "
454+ " \" localservicesnames\" : [ (array) the services we offer to the network, in human-readable form\n "
455+ " \" SERVICE_NAME\" , (string) the service name\n "
456+ " ...\n "
457+ " ],\n "
449458 " \" localrelay\" : true|false, (bool) true if transaction relay is requested from peers\n "
450459 " \" timeoffset\" : xxxxx, (numeric) the time offset\n "
451460 " \" connections\" : xxxxx, (numeric) the number of connections\n "
@@ -484,8 +493,11 @@ static UniValue getnetworkinfo(const JSONRPCRequest& request)
484493 obj.pushKV (" version" , CLIENT_VERSION);
485494 obj.pushKV (" subversion" , strSubVersion);
486495 obj.pushKV (" protocolversion" ,PROTOCOL_VERSION);
487- if (g_connman)
488- obj.pushKV (" localservices" , strprintf (" %016x" , g_connman->GetLocalServices ()));
496+ if (g_connman) {
497+ ServiceFlags services = g_connman->GetLocalServices ();
498+ obj.pushKV (" localservices" , strprintf (" %016x" , services));
499+ obj.pushKV (" localservicesnames" , GetServicesNames (services));
500+ }
489501 obj.pushKV (" localrelay" , g_relay_txes);
490502 obj.pushKV (" timeoffset" , GetTimeOffset ());
491503 if (g_connman) {
0 commit comments