Skip to content

Commit

Permalink
Merge pull request #1593 from evoskuil/master
Browse files Browse the repository at this point in the history
Consensus: fix tautological negative guards.
  • Loading branch information
evoskuil authored Jan 25, 2025
2 parents d6c2643 + d481d5f commit 489dae9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/bitcoin/system/impl/machine/program.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ peek_unsigned32(uint32_t& value) const NOEXCEPT
return false;

int64_t signed64;
if (!peek_signed40_(signed64) || is_negative(value))
if (!peek_signed40_(signed64) || is_negative(signed64))
return false;

// 32 bits are used in unsigned input.sequence compare.
Expand All @@ -441,7 +441,7 @@ peek_unsigned32(uint32_t& value) const NOEXCEPT
// ****************************************************************************
// CONSENSUS: Read of 40 bit (vs. 32 bit) value for comparison against uint32_t
// input.locktime allows use of the full unsigned 32 bit domain, without use of
// the negative range. Otherwise a 2038 limit (beyond the inherent 2106 limit)
// the negative range. Otherwise a 2038 limit (vs. the inherent 2106 limit)
// would have been introduced.
// ****************************************************************************
template <typename Stack>
Expand All @@ -452,7 +452,7 @@ peek_unsigned40(uint64_t& value) const NOEXCEPT
return false;

int64_t signed64;
if (!peek_signed40_(signed64) || is_negative(value))
if (!peek_signed40_(signed64) || is_negative(signed64))
return false;

// 40 bits are usable in unsigned tx.locktime compare.
Expand Down

0 comments on commit 489dae9

Please sign in to comment.