[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:
dergoegge
2023-11-27 17:22:41 +00:00
committed by stickies-v
parent ee178dfcc1
commit 7d9c3ec622
3 changed files with 17 additions and 2 deletions

View File

@@ -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;