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. The two line-number columns refer to before and after.

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