v29.4-roots.2 · Commit 3: [PATCH 03/21] policy: restore conservative relay and network controls
src/node/miner.h
Before: src/node/miner.h · After: src/node/miner.h
File metadata
index c45c97100d872d430cb5b513549c413227b7d967..4b4327ea2a80701f254587871599202e7faea7f3 100644
Download original patch · Release notes
Diff rows 1–40 of 40. 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
|
@@ -143,12 +143,15 @@ private:
|
|
|
143
143
|
// The constructed block template
|
|
144
144
|
std::unique_ptr<CBlockTemplate> pblocktemplate;
|
|
145
145
|
|
|
146
|
+
bool fNeedSizeAccounting{false};
|
|
147
|
+
|
|
146
148
|
// Information on the current status of the block
|
|
147
149
|
uint64_t nBlockWeight;
|
|
150
|
+
uint64_t nBlockSize{0};
|
|
148
151
|
uint64_t nBlockTx;
|
|
149
152
|
uint64_t nBlockSigOpsCost;
|
|
150
153
|
CAmount nFees;
|
|
151
|
-
std::unordered_set<Txid, SaltedTxidHasher> inBlock;
|
|
154
|
+
CTxMemPool::setEntries inBlock;
|
|
152
155
|
|
|
153
156
|
// Chain context for the block
|
|
154
157
|
int nHeight;
|
|
@@ -158,10 +161,14 @@ private:
|
|
|
158
161
|
const CTxMemPool* const m_mempool;
|
|
159
162
|
Chainstate& m_chainstate;
|
|
160
163
|
|
|
164
|
+
int lastFewTxs{0};
|
|
165
|
+
bool blockFinished{false};
|
|
166
|
+
|
|
161
167
|
public:
|
|
162
168
|
struct Options : BlockCreateOptions {
|
|
163
169
|
// Configuration parameters for the block size
|
|
164
170
|
size_t nBlockMaxWeight{DEFAULT_BLOCK_MAX_WEIGHT};
|
|
171
|
+
size_t nBlockMaxSize{MAX_BLOCK_SERIALIZED_SIZE};
|
|
165
172
|
CFeeRate blockMinFeeRate{DEFAULT_BLOCK_MIN_TX_FEE};
|
|
166
173
|
// Whether to call TestBlockValidity() at the end of CreateNewBlock().
|
|
167
174
|
bool test_block_validity{true};
|
|
@@ -196,6 +203,10 @@ private:
|
|
|
196
203
|
*/
|
|
197
204
|
void addPackageTxs(int& nPackagesSelected, int& nDescendantsUpdated) EXCLUSIVE_LOCKS_REQUIRED(!m_mempool->cs);
|
|
198
205
|
|
|
206
|
+
void addPriorityTxs(const CTxMemPool& mempool, int& nPackagesSelected) EXCLUSIVE_LOCKS_REQUIRED(mempool.cs);
|
|
207
|
+
bool TestForBlock(CTxMemPool::txiter iter);
|
|
208
|
+
bool isStillDependent(const CTxMemPool& mempool, CTxMemPool::txiter iter) EXCLUSIVE_LOCKS_REQUIRED(mempool.cs);
|
|
209
|
+
|
|
199
210
|
// helper functions for addPackageTxs()
|
|
200
211
|
/** Remove confirmed (inBlock) entries from given set */
|
|
201
212
|
void onlyUnconfirmed(CTxMemPool::setEntries& testSet);
|