diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-07-15 16:30:11 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-07-15 16:46:29 +0200 |
commit | 87e40799fdebb9f4c3c9d8cc7d071408a4ea768e (patch) | |
tree | bf9a644b0eaff1823f3c6c87f103319a4b000fd1 | |
parent | 4a56345a74d91ee4b311c4079f52c4943b8570f3 (diff) | |
parent | c4a321f5c6f266bdf99d7f3557210994b5c75f96 (diff) |
Merge pull request #4535
c4a321f Add peerid to getpeerinfo to allow correlation with the logs. (Gregory Maxwell)
-rw-r--r-- | src/rpcnet.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index 680717930b..bd3609b0c9 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -79,6 +79,7 @@ Value getpeerinfo(const Array& params, bool fHelp) "\nbResult:\n" "[\n" " {\n" + " \"id\": n, (numeric) Peer index\n" " \"addr\":\"host:port\", (string) The ip address and port of the peer\n" " \"addrlocal\":\"ip:port\", (string) local address\n" " \"services\":\"xxxxxxxxxxxxxxxx\", (string) The services offered\n" @@ -113,6 +114,7 @@ Value getpeerinfo(const Array& params, bool fHelp) Object obj; CNodeStateStats statestats; bool fStateStats = GetNodeStateStats(stats.nodeid, statestats); + obj.push_back(Pair("id", stats.nodeid)); obj.push_back(Pair("addr", stats.addrName)); if (!(stats.addrLocal.empty())) obj.push_back(Pair("addrlocal", stats.addrLocal)); |