From a529fd3e3f2391e592ac937e291fec51e067ea2e Mon Sep 17 00:00:00 2001 From: John Newbery Date: Mon, 24 Aug 2020 17:39:54 +0100 Subject: [net processing] Move GetNodeStateStats into PeerManager --- src/net_processing.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/net_processing.h') diff --git a/src/net_processing.h b/src/net_processing.h index 87eee566de..8f4ba4c0bb 100644 --- a/src/net_processing.h +++ b/src/net_processing.h @@ -32,6 +32,13 @@ static const bool DEFAULT_PEERBLOCKFILTERS = false; /** Threshold for marking a node to be discouraged, e.g. disconnected and added to the discouragement filter. */ static const int DISCOURAGEMENT_THRESHOLD{100}; +struct CNodeStateStats { + int m_misbehavior_score = 0; + int nSyncHeight = -1; + int nCommonHeight = -1; + std::vector vHeightInFlight; +}; + class PeerManager final : public CValidationInterface, public NetEventsInterface { public: PeerManager(const CChainParams& chainparams, CConnman& connman, BanMan* banman, @@ -94,6 +101,9 @@ public: */ void Misbehaving(const NodeId pnode, const int howmuch, const std::string& message); + /** Get statistics from node state */ + bool GetNodeStateStats(NodeId nodeid, CNodeStateStats& stats); + private: /** * Potentially mark a node discouraged based on the contents of a BlockValidationState object @@ -145,16 +155,6 @@ private: int64_t m_stale_tip_check_time; //!< Next time to check for stale tip }; -struct CNodeStateStats { - int m_misbehavior_score = 0; - int nSyncHeight = -1; - int nCommonHeight = -1; - std::vector vHeightInFlight; -}; - -/** Get statistics from node state */ -bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats); - /** Relay transaction to every node */ void RelayTransaction(const uint256& txid, const uint256& wtxid, const CConnman& connman) EXCLUSIVE_LOCKS_REQUIRED(cs_main); -- cgit v1.2.3