Skip to content

Commit b807dfc

Browse files
committed
miner: fix addPackageTxs unsigned integer overflow
1 parent d20f10a commit b807dfc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/node/miner.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,8 @@ void BlockAssembler::addPackageTxs(int& nPackagesSelected, int& nDescendantsUpda
397397

398398
++nConsecutiveFailed;
399399

400-
if (nConsecutiveFailed > MAX_CONSECUTIVE_FAILURES && nBlockWeight >
401-
m_options.nBlockMaxWeight - BLOCK_FULL_ENOUGH_WEIGHT_DELTA) {
400+
if (nConsecutiveFailed > MAX_CONSECUTIVE_FAILURES && nBlockWeight +
401+
BLOCK_FULL_ENOUGH_WEIGHT_DELTA > m_options.nBlockMaxWeight) {
402402
// Give up if we're close to full and haven't succeeded in a while
403403
break;
404404
}

0 commit comments

Comments
 (0)