@@ -82,6 +82,10 @@ static UniValue getpeerinfo(const JSONRPCRequest& request)
82
82
" \" addrbind\" :\" ip:port\" , (string) Bind address of the connection to the peer\n "
83
83
" \" addrlocal\" :\" ip:port\" , (string) Local address as reported by the peer\n "
84
84
" \" 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 "
85
89
" \" relaytxes\" :true|false, (boolean) Whether peer has asked us to relay transactions to it\n "
86
90
" \" lastsend\" : ttt, (numeric) The time in seconds since epoch (Jan 1 1970 GMT) of the last send\n "
87
91
" \" 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)
147
151
if (stats.addrBind .IsValid ())
148
152
obj.pushKV (" addrbind" , stats.addrBind .ToString ());
149
153
obj.pushKV (" services" , strprintf (" %016x" , stats.nServices ));
154
+ obj.pushKV (" servicesnames" , GetServicesNames (stats.nServices ));
150
155
obj.pushKV (" relaytxes" , stats.fRelayTxes );
151
156
obj.pushKV (" lastsend" , stats.nLastSend );
152
157
obj.pushKV (" lastrecv" , stats.nLastRecv );
@@ -446,6 +451,10 @@ static UniValue getnetworkinfo(const JSONRPCRequest& request)
446
451
" \" subversion\" : \" /Satoshi:x.x.x/\" , (string) the server subversion string\n "
447
452
" \" protocolversion\" : xxxxx, (numeric) the protocol version\n "
448
453
" \" 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 "
449
458
" \" localrelay\" : true|false, (bool) true if transaction relay is requested from peers\n "
450
459
" \" timeoffset\" : xxxxx, (numeric) the time offset\n "
451
460
" \" connections\" : xxxxx, (numeric) the number of connections\n "
@@ -484,8 +493,11 @@ static UniValue getnetworkinfo(const JSONRPCRequest& request)
484
493
obj.pushKV (" version" , CLIENT_VERSION);
485
494
obj.pushKV (" subversion" , strSubVersion);
486
495
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
+ }
489
501
obj.pushKV (" localrelay" , g_relay_txes);
490
502
obj.pushKV (" timeoffset" , GetTimeOffset ());
491
503
if (g_connman) {
0 commit comments