diff options
| author | Jon Atack <[email protected]> | 2020-08-15 11:07:02 +0200 |
|---|---|---|
| committer | Jon Atack <[email protected]> | 2020-08-15 14:34:37 +0200 |
| commit | 8a560a7d57cbd9f473d6a3782893a0e2243c55bd (patch) | |
| tree | b0f9e66ae90fbda9dd547bf352f102c9405ff016 /src | |
| parent | net: add nLastBlockTime/TXTime to CNodeStats, CNode::copyStats (diff) | |
| download | discoin-8a560a7d57cbd9f473d6a3782893a0e2243c55bd.tar.xz discoin-8a560a7d57cbd9f473d6a3782893a0e2243c55bd.zip | |
rpc: expose nLastBlockTime/TXTime as getpeerinfo last_block/transaction
Diffstat (limited to 'src')
| -rw-r--r-- | src/rpc/net.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index 9bd7c1599..e9343b334 100644 --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -100,6 +100,8 @@ static UniValue getpeerinfo(const JSONRPCRequest& request) {RPCResult::Type::BOOL, "relaytxes", "Whether peer has asked us to relay transactions to it"}, {RPCResult::Type::NUM_TIME, "lastsend", "The " + UNIX_EPOCH_TIME + " of the last send"}, {RPCResult::Type::NUM_TIME, "lastrecv", "The " + UNIX_EPOCH_TIME + " of the last receive"}, + {RPCResult::Type::NUM_TIME, "last_transaction", "The " + UNIX_EPOCH_TIME + " of the last valid transaction received from this peer"}, + {RPCResult::Type::NUM_TIME, "last_block", "The " + UNIX_EPOCH_TIME + " of the last block received from this peer"}, {RPCResult::Type::NUM, "bytessent", "The total bytes sent"}, {RPCResult::Type::NUM, "bytesrecv", "The total bytes received"}, {RPCResult::Type::NUM_TIME, "conntime", "The " + UNIX_EPOCH_TIME + " of the connection"}, @@ -169,6 +171,8 @@ static UniValue getpeerinfo(const JSONRPCRequest& request) obj.pushKV("relaytxes", stats.fRelayTxes); obj.pushKV("lastsend", stats.nLastSend); obj.pushKV("lastrecv", stats.nLastRecv); + obj.pushKV("last_transaction", stats.nLastTXTime); + obj.pushKV("last_block", stats.nLastBlockTime); obj.pushKV("bytessent", stats.nSendBytes); obj.pushKV("bytesrecv", stats.nRecvBytes); obj.pushKV("conntime", stats.nTimeConnected); |