v29.4-roots.3 · Commit 3: [PATCH 03/30] 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. Before is on the left; after is on the right. Unified view fits narrow screens more easily.
src/node/miner.h
CHANGED
|
@@ -143,12 +143,15 @@ private:
|
|
| 143 |
// The constructed block template
|
| 144 |
std::unique_ptr<CBlockTemplate> pblocktemplate;
|
| 145 |
|
|
|
|
|
|
|
| 146 |
// Information on the current status of the block
|
| 147 |
uint64_t nBlockWeight;
|
|
|
|
| 148 |
uint64_t nBlockTx;
|
| 149 |
uint64_t nBlockSigOpsCost;
|
| 150 |
CAmount nFees;
|
| 151 |
-
std::unordered_set<Txid, SaltedTxidHasher> inBlock;
|
| 152 |
|
| 153 |
// Chain context for the block
|
| 154 |
int nHeight;
|
|
@@ -158,10 +161,14 @@ private:
|
|
| 158 |
const CTxMemPool* const m_mempool;
|
| 159 |
Chainstate& m_chainstate;
|
| 160 |
|
|
|
|
|
|
|
|
|
|
| 161 |
public:
|
| 162 |
struct Options : BlockCreateOptions {
|
| 163 |
// Configuration parameters for the block size
|
| 164 |
size_t nBlockMaxWeight{DEFAULT_BLOCK_MAX_WEIGHT};
|
|
|
|
| 165 |
CFeeRate blockMinFeeRate{DEFAULT_BLOCK_MIN_TX_FEE};
|
| 166 |
// Whether to call TestBlockValidity() at the end of CreateNewBlock().
|
| 167 |
bool test_block_validity{true};
|
|
@@ -196,6 +203,10 @@ private:
|
|
| 196 |
*/
|
| 197 |
void addPackageTxs(int& nPackagesSelected, int& nDescendantsUpdated) EXCLUSIVE_LOCKS_REQUIRED(!m_mempool->cs);
|
| 198 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 199 |
// helper functions for addPackageTxs()
|
| 200 |
/** Remove confirmed (inBlock) entries from given set */
|
| 201 |
void onlyUnconfirmed(CTxMemPool::setEntries& testSet);
|
|
|
|
| 143 |
// The constructed block template
|
| 144 |
std::unique_ptr<CBlockTemplate> pblocktemplate;
|
| 145 |
|
| 146 |
+
bool fNeedSizeAccounting{false};
|
| 147 |
+
|
| 148 |
// Information on the current status of the block
|
| 149 |
uint64_t nBlockWeight;
|
| 150 |
+
uint64_t nBlockSize{0};
|
| 151 |
uint64_t nBlockTx;
|
| 152 |
uint64_t nBlockSigOpsCost;
|
| 153 |
CAmount nFees;
|
| 154 |
+
CTxMemPool::setEntries inBlock;
|
| 155 |
|
| 156 |
// Chain context for the block
|
| 157 |
int nHeight;
|
|
|
|
| 161 |
const CTxMemPool* const m_mempool;
|
| 162 |
Chainstate& m_chainstate;
|
| 163 |
|
| 164 |
+
int lastFewTxs{0};
|
| 165 |
+
bool blockFinished{false};
|
| 166 |
+
|
| 167 |
public:
|
| 168 |
struct Options : BlockCreateOptions {
|
| 169 |
// Configuration parameters for the block size
|
| 170 |
size_t nBlockMaxWeight{DEFAULT_BLOCK_MAX_WEIGHT};
|
| 171 |
+
size_t nBlockMaxSize{MAX_BLOCK_SERIALIZED_SIZE};
|
| 172 |
CFeeRate blockMinFeeRate{DEFAULT_BLOCK_MIN_TX_FEE};
|
| 173 |
// Whether to call TestBlockValidity() at the end of CreateNewBlock().
|
| 174 |
bool test_block_validity{true};
|
|
|
|
| 203 |
*/
|
| 204 |
void addPackageTxs(int& nPackagesSelected, int& nDescendantsUpdated) EXCLUSIVE_LOCKS_REQUIRED(!m_mempool->cs);
|
| 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 |
+
|
| 210 |
// helper functions for addPackageTxs()
|
| 211 |
/** Remove confirmed (inBlock) entries from given set */
|
| 212 |
void onlyUnconfirmed(CTxMemPool::setEntries& testSet);
|