diff options
author | fanquake <fanquake@gmail.com> | 2023-07-25 10:24:27 +0100 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2023-07-25 10:42:20 +0100 |
commit | c97270d722569933f2e8972675ac3cca8589febc (patch) | |
tree | dab464da8c9a72dee63cab34646835985cfd2e53 /src/net_processing.h | |
parent | d23fda05842ba4539b225bbab01b94df0060f697 (diff) | |
parent | 23c7b51ddd2888cf7fb260c439f004bd28768473 (diff) |
Merge bitcoin/bitcoin#27499: net processing, refactor: Decouple PeerManager from gArgs
23c7b51ddd2888cf7fb260c439f004bd28768473 [net processing] Move -capturemessages to PeerManager::Options (dergoegge)
bd59bda26b67b53293a5cef7433e992203da325a [net processing] Move -blockreconstructionextratxn to PeerManager::Options (dergoegge)
567c4e0b6a3fadd2fd1be732076026bf491519b2 [net processing] Move -maxorphantx to PeerManager::Options (dergoegge)
fa9e6d80d1c55f8b1bb2691bfd67e8c2b7189b38 [net processing] Move -txreconciliation to PeerManager::Options (dergoegge)
4cfb7b925f8fea818f03433882138a7d3d7e179a [net processing] Use ignore_incoming_txs from m_opts (dergoegge)
8b877259217c6da316153afb136a55c2dbd401c2 [net processing] Introduce PeerManager options (dergoegge)
Pull request description:
This PR decouples `PeerManager` from our global args manager by introducing `PeerManager::Options`.
ACKs for top commit:
stickies-v:
re-ACK 23c7b51ddd2888cf7fb260c439f004bd28768473
TheCharlatan:
ACK 23c7b51ddd2888cf7fb260c439f004bd28768473
Tree-SHA512: cd807b36ec018010e11935d3539fa7ed5015fdfb531d13a042a65b54ee8533a35a919a6a6c5fa293b5cba76000e9403c64dfd790fb9c649b7838544929b1fee8
Diffstat (limited to 'src/net_processing.h')
-rw-r--r-- | src/net_processing.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/net_processing.h b/src/net_processing.h index deebb24c94..a0cbe92289 100644 --- a/src/net_processing.h +++ b/src/net_processing.h @@ -14,6 +14,8 @@ class CChainParams; class CTxMemPool; class ChainstateManager; +/** Whether transaction reconciliation protocol should be enabled by default. */ +static constexpr bool DEFAULT_TXRECONCILIATION_ENABLE{false}; /** Default for -maxorphantx, maximum number of orphan transactions kept in memory */ static const unsigned int DEFAULT_MAX_ORPHAN_TRANSACTIONS = 100; /** Default number of orphan+recently-replaced txn to keep around for block reconstruction */ @@ -43,9 +45,18 @@ struct CNodeStateStats { class PeerManager : public CValidationInterface, public NetEventsInterface { public: + struct Options { + /** Whether this node is running in -blocksonly mode */ + bool ignore_incoming_txs{DEFAULT_BLOCKSONLY}; + bool reconcile_txs{DEFAULT_TXRECONCILIATION_ENABLE}; + uint32_t max_orphan_txs{DEFAULT_MAX_ORPHAN_TRANSACTIONS}; + size_t max_extra_txs{DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN}; + bool capture_messages{false}; + }; + static std::unique_ptr<PeerManager> make(CConnman& connman, AddrMan& addrman, BanMan* banman, ChainstateManager& chainman, - CTxMemPool& pool, bool ignore_incoming_txs); + CTxMemPool& pool, Options opts); virtual ~PeerManager() { } /** |