mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 06:49:38 -04:00
feefrac test: avoid integer overflow (bugfix)
This commit is contained in:
parent
cfe025ff0e
commit
a2bc330da8
1 changed files with 3 additions and 3 deletions
|
@ -220,9 +220,9 @@ FUZZ_TARGET(feefrac_mul_div)
|
|||
assert(res == res_fee);
|
||||
|
||||
// Compare approximately with CFeeRate.
|
||||
if (mul64 <= std::numeric_limits<int64_t>::max() / 1000 &&
|
||||
mul64 >= std::numeric_limits<int64_t>::min() / 1000 &&
|
||||
quot_abs <= arith_uint256{std::numeric_limits<int64_t>::max() / 1000}) {
|
||||
if (mul64 < std::numeric_limits<int64_t>::max() / 1000 &&
|
||||
mul64 > std::numeric_limits<int64_t>::min() / 1000 &&
|
||||
quot_abs < arith_uint256{std::numeric_limits<int64_t>::max() / 1000}) {
|
||||
CFeeRate feerate(mul64, (uint32_t)div);
|
||||
CAmount feerate_fee{feerate.GetFee(mul32)};
|
||||
auto allowed_gap = static_cast<int64_t>(mul32 / 1000 + 3 + round_down);
|
||||
|
|
Loading…
Add table
Reference in a new issue