Browse Source

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.
regtest_lnd
SomberNight 6 years ago
parent
commit
d3f65e24e1
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 6
      electrum/gui/kivy/uix/screens.py
  2. 4
      electrum/gui/qt/main_window.py
  3. 4
      electrum/gui/qt/transaction_dialog.py

6
electrum/gui/kivy/uix/screens.py

@ -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
@ -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))

4
electrum/gui/qt/main_window.py

@ -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():

4
electrum/gui/qt/transaction_dialog.py

@ -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)

Loading…
Cancel
Save