mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-23 14:10:15 +01:00
[net processing] Move GetNodeStateStats into PeerManager
This commit is contained in:
@@ -165,8 +165,9 @@ static RPCHelpMan getpeerinfo()
|
||||
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
|
||||
{
|
||||
NodeContext& node = EnsureNodeContext(request.context);
|
||||
if(!node.connman)
|
||||
if(!node.connman || !node.peerman) {
|
||||
throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, "Error: Peer-to-peer functionality missing or disabled");
|
||||
}
|
||||
|
||||
std::vector<CNodeStats> vstats;
|
||||
node.connman->GetNodeStats(vstats);
|
||||
@@ -176,7 +177,7 @@ static RPCHelpMan getpeerinfo()
|
||||
for (const CNodeStats& stats : vstats) {
|
||||
UniValue obj(UniValue::VOBJ);
|
||||
CNodeStateStats statestats;
|
||||
bool fStateStats = GetNodeStateStats(stats.nodeid, statestats);
|
||||
bool fStateStats = node.peerman->GetNodeStateStats(stats.nodeid, statestats);
|
||||
obj.pushKV("id", stats.nodeid);
|
||||
obj.pushKV("addr", stats.addrName);
|
||||
if (stats.addrBind.IsValid()) {
|
||||
|
||||
Reference in New Issue
Block a user