Skip to content

Commit 08843ed

Browse files
petertoddpstratem
authored andcommitted
Add relaytxes status to getpeerinfo
1 parent d8aaa51 commit 08843ed

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

src/net.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,7 @@ void CNode::copyStats(CNodeStats &stats)
617617
{
618618
stats.nodeid = this->GetId();
619619
X(nServices);
620+
X(fRelayTxes);
620621
X(nLastSend);
621622
X(nLastRecv);
622623
X(nTimeConnected);

src/net.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ class CNodeStats
180180
public:
181181
NodeId nodeid;
182182
uint64_t nServices;
183+
bool fRelayTxes;
183184
int64_t nLastSend;
184185
int64_t nLastRecv;
185186
int64_t nTimeConnected;

src/rpcnet.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ UniValue getpeerinfo(const UniValue& params, bool fHelp)
9090
" \"addr\":\"host:port\", (string) The ip address and port of the peer\n"
9191
" \"addrlocal\":\"ip:port\", (string) local address\n"
9292
" \"services\":\"xxxxxxxxxxxxxxxx\", (string) The services offered\n"
93+
" \"relaytxes\":true|false, (boolean) Whether peer has asked us to relay transactions to it\n"
9394
" \"lastsend\": ttt, (numeric) The time in seconds since epoch (Jan 1 1970 GMT) of the last send\n"
9495
" \"lastrecv\": ttt, (numeric) The time in seconds since epoch (Jan 1 1970 GMT) of the last receive\n"
9596
" \"bytessent\": n, (numeric) The total bytes sent\n"
@@ -134,6 +135,7 @@ UniValue getpeerinfo(const UniValue& params, bool fHelp)
134135
if (!(stats.addrLocal.empty()))
135136
obj.push_back(Pair("addrlocal", stats.addrLocal));
136137
obj.push_back(Pair("services", strprintf("%016x", stats.nServices)));
138+
obj.push_back(Pair("relaytxes", stats.fRelayTxes));
137139
obj.push_back(Pair("lastsend", stats.nLastSend));
138140
obj.push_back(Pair("lastrecv", stats.nLastRecv));
139141
obj.push_back(Pair("bytessent", stats.nSendBytes));

0 commit comments

Comments
 (0)