mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
Merge 524f981bb8
into 3a29ba33dc
This commit is contained in:
commit
444de228f9
1 changed files with 2 additions and 1 deletions
|
@ -311,6 +311,7 @@ void BlockAssembler::addPackageTxs(int& nPackagesSelected, int& nDescendantsUpda
|
||||||
// close to full; this is just a simple heuristic to finish quickly if the
|
// close to full; this is just a simple heuristic to finish quickly if the
|
||||||
// mempool has a lot of entries.
|
// mempool has a lot of entries.
|
||||||
const int64_t MAX_CONSECUTIVE_FAILURES = 1000;
|
const int64_t MAX_CONSECUTIVE_FAILURES = 1000;
|
||||||
|
constexpr int32_t BLOCK_FULL_ENOUGH_WEIGHT_DELTA = 4000;
|
||||||
int64_t nConsecutiveFailed = 0;
|
int64_t nConsecutiveFailed = 0;
|
||||||
|
|
||||||
while (mi != mempool.mapTx.get<ancestor_score>().end() || !mapModifiedTx.empty()) {
|
while (mi != mempool.mapTx.get<ancestor_score>().end() || !mapModifiedTx.empty()) {
|
||||||
|
@ -392,7 +393,7 @@ void BlockAssembler::addPackageTxs(int& nPackagesSelected, int& nDescendantsUpda
|
||||||
++nConsecutiveFailed;
|
++nConsecutiveFailed;
|
||||||
|
|
||||||
if (nConsecutiveFailed > MAX_CONSECUTIVE_FAILURES && nBlockWeight >
|
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
|
// Give up if we're close to full and haven't succeeded in a while
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue