aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.h
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2020-08-24 17:39:54 +0100
committerJohn Newbery <john@johnnewbery.com>2020-12-04 11:37:45 +0000
commita529fd3e3f2391e592ac937e291fec51e067ea2e (patch)
treeeafa7eadf6bfe611afe40a3bb8d325cbef602c18 /src/net_processing.h
parent257cf05f9b841ba30202f23a94bcdb1743feded2 (diff)
downloadbitcoin-a529fd3e3f2391e592ac937e291fec51e067ea2e.tar.xz
[net processing] Move GetNodeStateStats into PeerManager
Diffstat (limited to 'src/net_processing.h')
-rw-r--r--src/net_processing.h20
1 files changed, 10 insertions, 10 deletions
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<int> 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<int> 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);