From 02bbc053100ef99ca0f433b0a8c70961336ae79e Mon Sep 17 00:00:00 2001 From: Jesse Cohen Date: Fri, 8 Jun 2018 14:54:02 -0400 Subject: Rescope g_enable_bip61 to net_processing --- src/net_processing.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/net_processing.h') diff --git a/src/net_processing.h b/src/net_processing.h index b0b905d922..19e33f411a 100644 --- a/src/net_processing.h +++ b/src/net_processing.h @@ -37,8 +37,6 @@ static constexpr int64_t MINIMUM_CONNECT_TIME = 30; /** Default for BIP61 (sending reject messages) */ static constexpr bool DEFAULT_ENABLE_BIP61 = true; -/** Enable BIP61 (sending reject messages) */ -extern bool g_enable_bip61; class PeerLogicValidation final : public CValidationInterface, public NetEventsInterface { private: -- cgit v1.2.3 From 1d4df02b7e47f4805336e0dcd577f89b7ed16afe Mon Sep 17 00:00:00 2001 From: Jesse Cohen Date: Thu, 7 Jun 2018 14:32:43 -0400 Subject: [move-only] Move things only referenced in net_processing out of header file --- src/net_processing.h | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'src/net_processing.h') diff --git a/src/net_processing.h b/src/net_processing.h index 19e33f411a..9b867b25ec 100644 --- a/src/net_processing.h +++ b/src/net_processing.h @@ -12,29 +12,8 @@ /** Default for -maxorphantx, maximum number of orphan transactions kept in memory */ static const unsigned int DEFAULT_MAX_ORPHAN_TRANSACTIONS = 100; -/** Expiration time for orphan transactions in seconds */ -static const int64_t ORPHAN_TX_EXPIRE_TIME = 20 * 60; -/** Minimum time between orphan transactions expire time checks in seconds */ -static const int64_t ORPHAN_TX_EXPIRE_INTERVAL = 5 * 60; /** Default number of orphan+recently-replaced txn to keep around for block reconstruction */ static const unsigned int DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN = 100; -/** Headers download timeout expressed in microseconds - * Timeout = base + per_header * (expected number of headers) */ -static constexpr int64_t HEADERS_DOWNLOAD_TIMEOUT_BASE = 15 * 60 * 1000000; // 15 minutes -static constexpr int64_t HEADERS_DOWNLOAD_TIMEOUT_PER_HEADER = 1000; // 1ms/header -/** Protect at least this many outbound peers from disconnection due to slow/ - * behind headers chain. - */ -static constexpr int32_t MAX_OUTBOUND_PEERS_TO_PROTECT_FROM_DISCONNECT = 4; -/** Timeout for (unprotected) outbound peers to sync to our chainwork, in seconds */ -static constexpr int64_t CHAIN_SYNC_TIMEOUT = 20 * 60; // 20 minutes -/** How frequently to check for stale tips, in seconds */ -static constexpr int64_t STALE_CHECK_INTERVAL = 10 * 60; // 10 minutes -/** How frequently to check for extra outbound peers and disconnect, in seconds */ -static constexpr int64_t EXTRA_PEER_CHECK_INTERVAL = 45; -/** Minimum time an outbound-peer-eviction candidate must be connected for, in order to evict, in seconds */ -static constexpr int64_t MINIMUM_CONNECT_TIME = 30; - /** Default for BIP61 (sending reject messages) */ static constexpr bool DEFAULT_ENABLE_BIP61 = true; @@ -97,7 +76,5 @@ struct CNodeStateStats { /** Get statistics from node state */ bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats); -/** Increase a node's misbehavior score. */ -void Misbehaving(NodeId nodeid, int howmuch, const std::string& message=""); #endif // BITCOIN_NET_PROCESSING_H -- cgit v1.2.3 From 3339ba28e95aaaa355b7d33a69cffca7ab29b3fd Mon Sep 17 00:00:00 2001 From: Jesse Cohen Date: Mon, 9 Jul 2018 15:02:32 -0400 Subject: Make g_enable_bip61 a member variable of PeerLogicValidation --- src/net_processing.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/net_processing.h') diff --git a/src/net_processing.h b/src/net_processing.h index 9b867b25ec..a5f32c7842 100644 --- a/src/net_processing.h +++ b/src/net_processing.h @@ -22,7 +22,7 @@ private: CConnman* const connman; public: - explicit PeerLogicValidation(CConnman* connman, CScheduler &scheduler); + explicit PeerLogicValidation(CConnman* connman, CScheduler &scheduler, bool enable_bip61); /** * Overridden from CValidationInterface. @@ -65,6 +65,9 @@ public: private: int64_t m_stale_tip_check_time; //! Next time to check for stale tip + + /** Enable BIP61 (sending reject messages) */ + const bool m_enable_bip61; }; struct CNodeStateStats { -- cgit v1.2.3