mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01: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:
@@ -46,6 +46,10 @@ struct CNodeStateStats {
|
||||
std::chrono::seconds time_offset{0};
|
||||
};
|
||||
|
||||
struct PeerManagerInfo {
|
||||
std::chrono::seconds median_outbound_time_offset{0s};
|
||||
};
|
||||
|
||||
class PeerManager : public CValidationInterface, public NetEventsInterface
|
||||
{
|
||||
public:
|
||||
@@ -86,6 +90,9 @@ public:
|
||||
/** Get statistics from node state */
|
||||
virtual bool GetNodeStateStats(NodeId nodeid, CNodeStateStats& stats) const = 0;
|
||||
|
||||
/** Get peer manager info. */
|
||||
virtual PeerManagerInfo GetInfo() const = 0;
|
||||
|
||||
/** Whether this node ignores txs received over p2p. */
|
||||
virtual bool IgnoresIncomingTxs() = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user