Skip to content

Commit c4a321f

Browse files
committed
Add peerid to getpeerinfo to allow correlation with the logs.
This seems to have been missed in 3764.
1 parent 2c0f019 commit c4a321f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/rpcnet.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ Value getpeerinfo(const Array& params, bool fHelp)
7979
"\nbResult:\n"
8080
"[\n"
8181
" {\n"
82+
" \"id\": n, (numeric) Peer index\n"
8283
" \"addr\":\"host:port\", (string) The ip address and port of the peer\n"
8384
" \"addrlocal\":\"ip:port\", (string) local address\n"
8485
" \"services\":\"xxxxxxxxxxxxxxxx\", (string) The services offered\n"
@@ -113,6 +114,7 @@ Value getpeerinfo(const Array& params, bool fHelp)
113114
Object obj;
114115
CNodeStateStats statestats;
115116
bool fStateStats = GetNodeStateStats(stats.nodeid, statestats);
117+
obj.push_back(Pair("id", stats.nodeid));
116118
obj.push_back(Pair("addr", stats.addrName));
117119
if (!(stats.addrLocal.empty()))
118120
obj.push_back(Pair("addrlocal", stats.addrLocal));

0 commit comments

Comments
 (0)