diff --git a/src/node/miner.cpp b/src/node/miner.cpp index 33eeaf91fb2..2b9c07d4695 100644 --- a/src/node/miner.cpp +++ b/src/node/miner.cpp @@ -314,6 +314,7 @@ void BlockAssembler::addPackageTxs(int& nPackagesSelected, int& nDescendantsUpda // close to full; this is just a simple heuristic to finish quickly if the // mempool has a lot of entries. const int64_t MAX_CONSECUTIVE_FAILURES = 1000; + constexpr int32_t BLOCK_FULL_ENOUGH_WEIGHT_DELTA = 4000; int64_t nConsecutiveFailed = 0; while (mi != mempool.mapTx.get().end() || !mapModifiedTx.empty()) { @@ -395,7 +396,7 @@ void BlockAssembler::addPackageTxs(int& nPackagesSelected, int& nDescendantsUpda ++nConsecutiveFailed; if (nConsecutiveFailed > MAX_CONSECUTIVE_FAILURES && nBlockWeight > - m_options.nBlockMaxWeight - m_options.block_reserved_weight) { + m_options.nBlockMaxWeight - BLOCK_FULL_ENOUGH_WEIGHT_DELTA) { // Give up if we're close to full and haven't succeeded in a while break; }