From 792c248919c8c53e93a70340c46f669d34d99bed Mon Sep 17 00:00:00 2001 From: SomberNight Date: Mon, 4 Jun 2018 21:17:25 +0200 Subject: [PATCH] Qt: FeerateEdit.get_amount now returns sat/byte --- gui/qt/amountedit.py | 4 +--- gui/qt/main_window.py | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/gui/qt/amountedit.py b/gui/qt/amountedit.py index 5d0cb29f2..7d802a4b6 100644 --- a/gui/qt/amountedit.py +++ b/gui/qt/amountedit.py @@ -121,9 +121,7 @@ class FeerateEdit(BTCAmountEdit): def get_amount(self): sat_per_byte_amount = BTCAmountEdit.get_amount(self) - if sat_per_byte_amount is None: - return None - return 1000 * sat_per_byte_amount + return quantize_feerate(sat_per_byte_amount) def setAmount(self, amount): amount = quantize_feerate(amount) diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py index fbf5ff0e3..1397f0908 100644 --- a/gui/qt/main_window.py +++ b/gui/qt/main_window.py @@ -1338,7 +1338,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): if freeze_feerate or self.fee_slider.is_active(): displayed_feerate = self.feerate_e.get_amount() if displayed_feerate: - displayed_feerate = quantize_feerate(displayed_feerate / 1000) + displayed_feerate = quantize_feerate(displayed_feerate) else: # fallback to actual fee displayed_feerate = quantize_feerate(fee / size) if fee is not None else None @@ -1438,8 +1438,8 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): if self.is_send_fee_frozen(): fee_estimator = self.fee_e.get_amount() elif self.is_send_feerate_frozen(): - amount = self.feerate_e.get_amount() - amount = 0 if amount is None else amount + amount = self.feerate_e.get_amount() # sat/byte feerate + amount = 0 if amount is None else amount * 1000 # sat/kilobyte feerate fee_estimator = partial( simple_config.SimpleConfig.estimate_fee_for_feerate, amount) else: