|
|
@ -79,6 +79,7 @@ Value getpeerinfo(const Array& params, bool fHelp) |
|
|
|
"\nbResult:\n" |
|
|
|
"\nbResult:\n" |
|
|
|
"[\n" |
|
|
|
"[\n" |
|
|
|
" {\n" |
|
|
|
" {\n" |
|
|
|
|
|
|
|
" \"id\": n, (numeric) Peer index\n" |
|
|
|
" \"addr\":\"host:port\", (string) The ip address and port of the peer\n" |
|
|
|
" \"addr\":\"host:port\", (string) The ip address and port of the peer\n" |
|
|
|
" \"addrlocal\":\"ip:port\", (string) local address\n" |
|
|
|
" \"addrlocal\":\"ip:port\", (string) local address\n" |
|
|
|
" \"services\":\"xxxxxxxxxxxxxxxx\", (string) The services offered\n" |
|
|
|
" \"services\":\"xxxxxxxxxxxxxxxx\", (string) The services offered\n" |
|
|
@ -113,6 +114,7 @@ Value getpeerinfo(const Array& params, bool fHelp) |
|
|
|
Object obj; |
|
|
|
Object obj; |
|
|
|
CNodeStateStats statestats; |
|
|
|
CNodeStateStats statestats; |
|
|
|
bool fStateStats = GetNodeStateStats(stats.nodeid, statestats); |
|
|
|
bool fStateStats = GetNodeStateStats(stats.nodeid, statestats); |
|
|
|
|
|
|
|
obj.push_back(Pair("id", stats.nodeid)); |
|
|
|
obj.push_back(Pair("addr", stats.addrName)); |
|
|
|
obj.push_back(Pair("addr", stats.addrName)); |
|
|
|
if (!(stats.addrLocal.empty())) |
|
|
|
if (!(stats.addrLocal.empty())) |
|
|
|
obj.push_back(Pair("addrlocal", stats.addrLocal)); |
|
|
|
obj.push_back(Pair("addrlocal", stats.addrLocal)); |
|
|
|