Skip to content
Bitcoin Roots

v30.3-roots.1 · Commit 3: [PATCH 03/68] feat(policy): preserve Roots relay and network controls on Core 30.3

src/net_processing.h

Before: src/net_processing.h · After: src/net_processing.h

File metadata
index 8c140d98ad66bdc32edd3562427fd792fb817227..925adc5f77f8a9a0e8dfcbb03bd06fd0c4152a7a 100644

Download original patch · Release notes

Diff rows 1–52 of 52. Line numbers refer to the original before/after files.

+ Added− RemovedUnmarked lines are context.

Scroll the code area horizontally to read long lines. The two line-number columns refer to before and after.

src/net_processing.h CHANGED
@@ -36,9 +36,13 @@ class Warnings;
36
36
 
37
37
  /** Whether transaction reconciliation protocol should be enabled by default. */
38
38
  static constexpr bool DEFAULT_TXRECONCILIATION_ENABLE{false};
39
+ /** Whether to announce a fee filter to compatible transaction-relay peers. */
40
+ static constexpr bool DEFAULT_FEEFILTER{true};
41
+ static constexpr size_t BLOCK_RECONSTRUCTION_EXTRA_TXN_PER_TXN_SIZE_LIMIT{100000};
42
+ static const size_t DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN_SIZE{10000000};
39
43
  /** Default number of non-mempool transactions to keep around for block reconstruction. Includes
40
44
  orphan, replaced, and rejected transactions. */
41
- static const uint32_t DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN{100};
45
+ static const uint32_t DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN{32768};
42
46
  static const bool DEFAULT_PEERBLOOMFILTERS = false;
43
47
  static const bool DEFAULT_PEERBLOCKFILTERS = false;
44
48
  /** Maximum number of outstanding CMPCTBLOCK requests for the same block. */
@@ -61,6 +65,8 @@ struct CNodeStateStats {
61
65
  ServiceFlags their_services;
62
66
  int64_t presync_height{-1};
63
67
  std::chrono::seconds time_offset{0};
68
+ NodeSeconds m_last_block_announcement;
69
+ int m_misbehavior_score{0};
64
70
  };
65
71
 
66
72
  struct PeerManagerInfo {
@@ -79,6 +85,7 @@ public:
79
85
  //! Number of non-mempool transactions to keep around for block reconstruction. Includes
80
86
  //! orphan, replaced, and rejected transactions.
81
87
  uint32_t max_extra_txs{DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN};
88
+ size_t max_extra_txs_size{DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN_SIZE};
82
89
  //! Whether all P2P messages are captured to disk
83
90
  bool capture_messages{false};
84
91
  //! Whether or not the internal RNG behaves deterministically (this is
@@ -95,13 +102,14 @@ public:
95
102
  virtual ~PeerManager() = default;
96
103
 
97
104
  /**
98
- * Attempt to manually fetch block from a given peer. We must already have the header.
105
+ * Attempt to manually fetch block from a given peer.
99
106
  *
100
107
  * @param[in] peer_id The peer id
101
108
  * @param[in] block_index The blockindex
102
109
  * @returns std::nullopt if a request was successfully made, otherwise an error message
103
110
  */
104
- virtual std::optional<std::string> FetchBlock(NodeId peer_id, const CBlockIndex& block_index) = 0;
111
+ std::optional<std::string> FetchBlock(NodeId peer_id, const CBlockIndex& block_index);
112
+ virtual std::optional<std::string> FetchBlock(NodeId peer_id, const uint256& hash, const CBlockIndex* block_index) = 0;
105
113
 
106
114
  /** Begin running background tasks, should only be called once */
107
115
  virtual void StartScheduledTasks(CScheduler& scheduler) = 0;
@@ -161,6 +169,7 @@ public:
161
169
  * we do not have a confirmed set of service flags.
162
170
  */
163
171
  virtual ServiceFlags GetDesirableServiceFlags(ServiceFlags services) const = 0;
172
+
164
173
  };
165
174
 
166
175
  #endif // BITCOIN_NET_PROCESSING_H