mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-13 08:09:27 +02:00
[net processing] Introduce PeerManagerInfo
For querying statistics/info from PeerManager. The median outbound time offset is the only initial field.
This commit is contained in:
@@ -23,7 +23,6 @@
|
||||
#include <rpc/server_util.h>
|
||||
#include <rpc/util.h>
|
||||
#include <sync.h>
|
||||
#include <timedata.h>
|
||||
#include <util/chaintype.h>
|
||||
#include <util/strencodings.h>
|
||||
#include <util/string.h>
|
||||
@@ -679,9 +678,10 @@ static RPCHelpMan getnetworkinfo()
|
||||
obj.pushKV("localservicesnames", GetServicesNames(services));
|
||||
}
|
||||
if (node.peerman) {
|
||||
auto peerman_info{node.peerman->GetInfo()};
|
||||
obj.pushKV("localrelay", !node.peerman->IgnoresIncomingTxs());
|
||||
obj.pushKV("timeoffset", Ticks<std::chrono::seconds>(peerman_info.median_outbound_time_offset));
|
||||
}
|
||||
obj.pushKV("timeoffset", GetTimeOffset());
|
||||
if (node.connman) {
|
||||
obj.pushKV("networkactive", node.connman->GetNetworkActive());
|
||||
obj.pushKV("connections", node.connman->GetNodeCount(ConnectionDirection::Both));
|
||||
|
||||
Reference in New Issue
Block a user