miner: fix `addPackageTxs` unsigned integer overflow

This commit is contained in:
ismaelsadeeq 2025-09-24 16:31:38 +02:00
parent d20f10affb
commit b807dfcdc5
No known key found for this signature in database
GPG Key ID: 0E3908F364989888
1 changed files with 2 additions and 2 deletions

View File

@ -397,8 +397,8 @@ void BlockAssembler::addPackageTxs(int& nPackagesSelected, int& nDescendantsUpda
++nConsecutiveFailed;
if (nConsecutiveFailed > MAX_CONSECUTIVE_FAILURES && nBlockWeight >
m_options.nBlockMaxWeight - BLOCK_FULL_ENOUGH_WEIGHT_DELTA) {
if (nConsecutiveFailed > MAX_CONSECUTIVE_FAILURES && nBlockWeight +
BLOCK_FULL_ENOUGH_WEIGHT_DELTA > m_options.nBlockMaxWeight) {
// Give up if we're close to full and haven't succeeded in a while
break;
}