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/node/miner.h

Before: src/node/miner.h · After: src/node/miner.h

File metadata
index ce9c744dcb90e5b07b4d15db7e82473896f96d89..3e4c082114fb2a9653107eba05ab1af90d69ed36 100644

Download original patch · Release notes

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

+ Added− RemovedUnmarked lines are context.

Scroll the code area horizontally to read long lines. Before is on the left; after is on the right. Unified view fits narrow screens more easily.

src/node/miner.h CHANGED
@@ -150,12 +150,15 @@ private:
150
  // The constructed block template
151
  std::unique_ptr<CBlockTemplate> pblocktemplate;
152
 
 
 
153
  // Information on the current status of the block
154
  uint64_t nBlockWeight;
 
155
  uint64_t nBlockTx;
156
  uint64_t nBlockSigOpsCost;
157
  CAmount nFees;
158
- std::unordered_set<Txid, SaltedTxidHasher> inBlock;
159
 
160
  // Chain context for the block
161
  int nHeight;
@@ -165,10 +168,14 @@ private:
165
  const CTxMemPool* const m_mempool;
166
  Chainstate& m_chainstate;
167
 
 
 
 
168
  public:
169
  struct Options : BlockCreateOptions {
170
  // Configuration parameters for the block size
171
  size_t nBlockMaxWeight{DEFAULT_BLOCK_MAX_WEIGHT};
 
172
  CFeeRate blockMinFeeRate{DEFAULT_BLOCK_MIN_TX_FEE};
173
  // Whether to call TestBlockValidity() at the end of CreateNewBlock().
174
  bool test_block_validity{true};
@@ -201,7 +208,11 @@ private:
201
  *
202
  * @pre BlockAssembler::m_mempool must not be nullptr
203
  */
204
- void addPackageTxs(int& nPackagesSelected, int& nDescendantsUpdated) EXCLUSIVE_LOCKS_REQUIRED(!m_mempool->cs);
 
 
 
 
205
 
206
  // helper functions for addPackageTxs()
207
  /** Remove confirmed (inBlock) entries from given set */
 
150
  // The constructed block template
151
  std::unique_ptr<CBlockTemplate> pblocktemplate;
152
 
153
+ bool fNeedSizeAccounting{false};
154
+
155
  // Information on the current status of the block
156
  uint64_t nBlockWeight;
157
+ uint64_t nBlockSize{0};
158
  uint64_t nBlockTx;
159
  uint64_t nBlockSigOpsCost;
160
  CAmount nFees;
161
+ CTxMemPool::setEntries inBlock;
162
 
163
  // Chain context for the block
164
  int nHeight;
 
168
  const CTxMemPool* const m_mempool;
169
  Chainstate& m_chainstate;
170
 
171
+ int lastFewTxs{0};
172
+ bool blockFinished{false};
173
+
174
  public:
175
  struct Options : BlockCreateOptions {
176
  // Configuration parameters for the block size
177
  size_t nBlockMaxWeight{DEFAULT_BLOCK_MAX_WEIGHT};
178
+ size_t nBlockMaxSize{MAX_BLOCK_SERIALIZED_SIZE};
179
  CFeeRate blockMinFeeRate{DEFAULT_BLOCK_MIN_TX_FEE};
180
  // Whether to call TestBlockValidity() at the end of CreateNewBlock().
181
  bool test_block_validity{true};
 
208
  *
209
  * @pre BlockAssembler::m_mempool must not be nullptr
210
  */
211
+ void addPackageTxs(const CTxMemPool& mempool, int& nPackagesSelected, int& nDescendantsUpdated) EXCLUSIVE_LOCKS_REQUIRED(mempool.cs);
212
+
213
+ void addPriorityTxs(const CTxMemPool& mempool, int& nPackagesSelected) EXCLUSIVE_LOCKS_REQUIRED(mempool.cs);
214
+ bool TestForBlock(CTxMemPool::txiter iter);
215
+ bool isStillDependent(const CTxMemPool& mempool, CTxMemPool::txiter iter) EXCLUSIVE_LOCKS_REQUIRED(mempool.cs);
216
 
217
  // helper functions for addPackageTxs()
218
  /** Remove confirmed (inBlock) entries from given set */