tkivy: warn user during "Send" if high fee (change condition) - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit d3f65e24e143121e6209547d49463171af01b1a0 DIR parent a762687740ff5ee60255b7ddbaeaad48e26de19d HTML Author: SomberNight <somber.night@protonmail.com> Date: Fri, 17 May 2019 20:10:10 +0200 kivy: warn user during "Send" if high fee (change condition) Specifically, warning was previously triggered if fee > 1 mBTC; now it is unified with Qt, warning is triggered if feerate > 600 sat/byte. Diffstat: M electrum/gui/kivy/uix/screens.py | 6 ++++-- M electrum/gui/qt/main_window.py | 4 ++-- M electrum/gui/qt/transaction_dialog… | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) --- DIR diff --git a/electrum/gui/kivy/uix/screens.py b/electrum/gui/kivy/uix/screens.py t@@ -25,6 +25,7 @@ from electrum.util import send_exception_to_crash_reporter from electrum.paymentrequest import PR_UNPAID, PR_PAID, PR_UNKNOWN, PR_EXPIRED from electrum.plugin import run_hook from electrum.wallet import InternalAddressCorruption +from electrum import simple_config from .context_menu import ContextMenu t@@ -293,8 +294,9 @@ class SendScreen(CScreen): x_fee_address, x_fee_amount = x_fee msg.append(_("Additional fees") + ": " + self.app.format_amount_and_units(x_fee_amount)) - if fee >= config.get('confirm_fee', 100000): - msg.append(_('Warning')+ ': ' + _("The fee for this transaction seems unusually high.")) + feerate_warning = simple_config.FEERATE_WARNING_HIGH_FEE + if fee > feerate_warning * tx.estimated_size() / 1000: + msg.append(_('Warning') + ': ' + _("The fee for this transaction seems unusually high.")) msg.append(_("Enter your PIN code to proceed")) self.app.protected('\n'.join(msg), self.send_tx, (tx, message)) DIR diff --git a/electrum/gui/qt/main_window.py b/electrum/gui/qt/main_window.py t@@ -1683,8 +1683,8 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger): x_fee_address, x_fee_amount = x_fee msg.append( _("Additional fees") + ": " + self.format_amount_and_units(x_fee_amount) ) - confirm_rate = simple_config.FEERATE_WARNING_HIGH_FEE - if fee > confirm_rate * tx.estimated_size() / 1000: + feerate_warning = simple_config.FEERATE_WARNING_HIGH_FEE + if fee > feerate_warning * tx.estimated_size() / 1000: msg.append(_('Warning') + ': ' + _("The fee for this transaction seems unusually high.")) if self.wallet.has_keystore_encryption(): DIR diff --git a/electrum/gui/qt/transaction_dialog.py b/electrum/gui/qt/transaction_dialog.py t@@ -273,8 +273,8 @@ class TxDialog(QDialog, MessageBoxMixin): if fee is not None: fee_rate = fee/size*1000 fee_str += ' ( %s ) ' % self.main_window.format_fee_rate(fee_rate) - confirm_rate = simple_config.FEERATE_WARNING_HIGH_FEE - if fee_rate > confirm_rate: + feerate_warning = simple_config.FEERATE_WARNING_HIGH_FEE + if fee_rate > feerate_warning: fee_str += ' - ' + _('Warning') + ': ' + _("high fee") + '!' self.amount_label.setText(amount_str) self.fee_label.setText(fee_str)