Add relaytxes status to getpeerinfo

This commit is contained in:
Peter Todd 2015-11-20 18:51:44 -05:00 committed by Jack Grigg
parent bd129f177f
commit f191acc477
3 changed files with 4 additions and 0 deletions

View File

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

View File

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

View File

@ -87,6 +87,7 @@ UniValue getpeerinfo(const UniValue& params, bool fHelp)
" \"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"
" \"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"
" \"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"
@ -130,6 +131,7 @@ UniValue getpeerinfo(const UniValue& params, bool fHelp)
if (!(stats.addrLocal.empty()))
obj.pushKV("addrlocal", stats.addrLocal);
obj.pushKV("services", strprintf("%016x", stats.nServices));
obj.pushKV("relaytxes", stats.fRelayTxes);
obj.pushKV("lastsend", stats.nLastSend);
obj.pushKV("lastrecv", stats.nLastRecv);
obj.pushKV("bytessent", stats.nSendBytes);