From e90534beaaa89127f29c5439056ba74c27663213 Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Tue, 19 Aug 2025 14:16:32 +0200 Subject: [PATCH] fee_policy: use FEERATE_PRECISION for .. precision --- electrum/fee_policy.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/electrum/fee_policy.py b/electrum/fee_policy.py index 2d76902cb..28c5db8f2 100644 --- a/electrum/fee_policy.py +++ b/electrum/fee_policy.py @@ -5,7 +5,7 @@ from enum import IntEnum import math from .i18n import _ -from .util import NoDynamicFeeEstimates, quantize_feerate, format_fee_satoshis +from .util import NoDynamicFeeEstimates, quantize_feerate, format_fee_satoshis, FEERATE_PRECISION from . import util, constants from .logging import Logger @@ -363,9 +363,9 @@ class FeeHistogram: slot = min(item[1], bytes_limit - bytes_current) bytes_current += slot # round & limit precision - value = int(item[0] * 100) / 100 + value = int(item[0] * 10**FEERATE_PRECISION) / 10**FEERATE_PRECISION capped_histogram.append([ - max(FEERATE_MIN_RELAY/1000, value), # clamped to [FEERATE_MIN_RELAY/1000,inf] + max(FEERATE_MIN_RELAY/1000, value), # clamped to [FEERATE_MIN_RELAY/1000, inf) slot, # width of bucket bytes_current, # cumulative depth at far end of bucket ])