From 45703931e5290dbae44b080394550234489fb704 Mon Sep 17 00:00:00 2001 From: ismaelsadeeq Date: Wed, 24 Sep 2025 16:31:38 +0200 Subject: [PATCH] miner: fix `addPackageTxs` unsigned integer overflow Github-Pull: #33475 Rebased-From: b807dfcdc5929c314d43b790c9e705d5bf0a86e8 --- src/node/miner.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node/miner.cpp b/src/node/miner.cpp index a08c70e29da..e75bc3a603b 100644 --- a/src/node/miner.cpp +++ b/src/node/miner.cpp @@ -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; }