From d8dad74267fe1bdcd98dce0d79e2196f7ced60dc Mon Sep 17 00:00:00 2001 From: SomberNight Date: Fri, 9 Feb 2018 00:16:11 +0100 Subject: [PATCH] fee calculation: force back-end to use integer sat/bytes --- lib/simple_config.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/simple_config.py b/lib/simple_config.py index b7a41ddcc44b..c0bbb2162964 100644 --- a/lib/simple_config.py +++ b/lib/simple_config.py @@ -428,7 +428,12 @@ def estimate_fee(self, size): @classmethod def estimate_fee_for_feerate(cls, fee_per_kb, size): - return int(fee_per_kb * size / 1000.) + # note: We only allow integer sat/byte values atm. + # The GUI for simplicity reasons only displays integer sat/byte, + # and for the sake of consistency, we thus only use integer sat/byte in + # the backend too. + fee_per_byte = int(fee_per_kb / 1000) + return int(fee_per_byte * size) def update_fee_estimates(self, key, value): self.fee_estimates[key] = value