Browse Source

Add relaytxes status to getpeerinfo

0.13
Peter Todd 9 years ago committed by Patick Strateman
parent
commit
08843ed998
  1. 1
      src/net.cpp
  2. 1
      src/net.h
  3. 2
      src/rpcnet.cpp

1
src/net.cpp

@ -617,6 +617,7 @@ void CNode::copyStats(CNodeStats &stats)
{ {
stats.nodeid = this->GetId(); stats.nodeid = this->GetId();
X(nServices); X(nServices);
X(fRelayTxes);
X(nLastSend); X(nLastSend);
X(nLastRecv); X(nLastRecv);
X(nTimeConnected); X(nTimeConnected);

1
src/net.h

@ -180,6 +180,7 @@ class CNodeStats
public: public:
NodeId nodeid; NodeId nodeid;
uint64_t nServices; uint64_t nServices;
bool fRelayTxes;
int64_t nLastSend; int64_t nLastSend;
int64_t nLastRecv; int64_t nLastRecv;
int64_t nTimeConnected; int64_t nTimeConnected;

2
src/rpcnet.cpp

@ -90,6 +90,7 @@ UniValue getpeerinfo(const UniValue& params, bool fHelp)
" \"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"
" \"relaytxes\":true|false, (boolean) Whether peer has asked us to relay transactions to it\n"
" \"lastsend\": ttt, (numeric) The time in seconds since epoch (Jan 1 1970 GMT) of the last send\n" " \"lastsend\": ttt, (numeric) The time in seconds since epoch (Jan 1 1970 GMT) of the last send\n"
" \"lastrecv\": ttt, (numeric) The time in seconds since epoch (Jan 1 1970 GMT) of the last receive\n" " \"lastrecv\": ttt, (numeric) The time in seconds since epoch (Jan 1 1970 GMT) of the last receive\n"
" \"bytessent\": n, (numeric) The total bytes sent\n" " \"bytessent\": n, (numeric) The total bytes sent\n"
@ -134,6 +135,7 @@ UniValue getpeerinfo(const UniValue& params, bool fHelp)
if (!(stats.addrLocal.empty())) if (!(stats.addrLocal.empty()))
obj.push_back(Pair("addrlocal", stats.addrLocal)); obj.push_back(Pair("addrlocal", stats.addrLocal));
obj.push_back(Pair("services", strprintf("%016x", stats.nServices))); obj.push_back(Pair("services", strprintf("%016x", stats.nServices)));
obj.push_back(Pair("relaytxes", stats.fRelayTxes));
obj.push_back(Pair("lastsend", stats.nLastSend)); obj.push_back(Pair("lastsend", stats.nLastSend));
obj.push_back(Pair("lastrecv", stats.nLastRecv)); obj.push_back(Pair("lastrecv", stats.nLastRecv));
obj.push_back(Pair("bytessent", stats.nSendBytes)); obj.push_back(Pair("bytessent", stats.nSendBytes));

Loading…
Cancel
Save