mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-10-10 11:33:46 +02:00
[net processing] Move ping data fields to net processing
This commit is contained in:
@@ -77,13 +77,12 @@ static RPCHelpMan ping()
|
||||
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
|
||||
{
|
||||
NodeContext& node = EnsureNodeContext(request.context);
|
||||
if(!node.connman)
|
||||
if (!node.peerman) {
|
||||
throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, "Error: Peer-to-peer functionality missing or disabled");
|
||||
}
|
||||
|
||||
// Request that each node send a ping during next message processing pass
|
||||
node.connman->ForEachNode([](CNode* pnode) {
|
||||
pnode->fPingQueued = true;
|
||||
});
|
||||
node.peerman->SendPings();
|
||||
return NullUniValue;
|
||||
},
|
||||
};
|
||||
@@ -209,8 +208,8 @@ static RPCHelpMan getpeerinfo()
|
||||
if (stats.m_min_ping_usec < std::numeric_limits<int64_t>::max()) {
|
||||
obj.pushKV("minping", ((double)stats.m_min_ping_usec) / 1e6);
|
||||
}
|
||||
if (stats.m_ping_wait_usec > 0) {
|
||||
obj.pushKV("pingwait", ((double)stats.m_ping_wait_usec) / 1e6);
|
||||
if (fStateStats && statestats.m_ping_wait_usec > 0) {
|
||||
obj.pushKV("pingwait", ((double)statestats.m_ping_wait_usec) / 1e6);
|
||||
}
|
||||
obj.pushKV("version", stats.nVersion);
|
||||
// Use the sanitized form of subver here, to avoid tricksy remote peers from
|
||||
|
Reference in New Issue
Block a user