tQt: feerate edit was sometimes rounding inconsistently - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 9788ca025066ba14fa1dd2fb83e5bce765ddfac7 DIR parent d667c5d46e3347c05fd031169e9e4952df509d2a HTML Author: SomberNight <somber.night@protonmail.com> Date: Mon, 4 Jun 2018 21:01:47 +0200 Qt: feerate edit was sometimes rounding inconsistently Diffstat: M gui/qt/amountedit.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- DIR diff --git a/gui/qt/amountedit.py b/gui/qt/amountedit.py t@@ -6,7 +6,8 @@ from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import (QLineEdit, QStyle, QStyleOptionFrame) -from electrum.util import format_satoshis_plain, decimal_point_to_base_unit_name, FEERATE_PRECISION +from electrum.util import (format_satoshis_plain, decimal_point_to_base_unit_name, + FEERATE_PRECISION, quantize_feerate) class MyLineEdit(QLineEdit): t@@ -123,3 +124,7 @@ class FeerateEdit(BTCAmountEdit): if sat_per_byte_amount is None: return None return 1000 * sat_per_byte_amount + + def setAmount(self, amount): + amount = quantize_feerate(amount) + super().setAmount(amount)