electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 192238985e1c00655106fa802bd5f426d9c68448
parent 99cc3fcf908835bdba791e836bfeb1276a2fbe3e
Author: ThomasV <thomasv@electrum.org>
Date:   Mon,  6 Mar 2017 11:37:42 +0100

fix fee rate issue caused by changing tx size

Diffstat:
Mgui/qt/main_window.py | 12+++++-------
1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py @@ -1242,11 +1242,8 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): self.show_error(_('Invalid Amount')) return - fee = self.fee_e.get_amount() - if fee is None: - self.show_error(_('Invalid Fee')) - return - + freeze_fee = (self.fee_e.isModified() and (self.fee_e.text() or self.fee_e.hasFocus())) + fee = self.fee_e.get_amount() if freeze_fee else None coins = self.get_coins() return outputs, fee, label, coins @@ -1271,12 +1268,13 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): return amount = tx.output_value() if self.is_max else sum(map(lambda x:x[2], outputs)) + fee = tx.get_fee() use_rbf = self.rbf_checkbox.isChecked() if use_rbf: tx.set_sequence(0) - if tx.get_fee() < self.wallet.relayfee() * tx.estimated_size() / 1000 and tx.requires_fee(self.wallet): + if fee < self.wallet.relayfee() * tx.estimated_size() / 1000 and tx.requires_fee(self.wallet): self.show_error(_("This transaction requires a higher fee, or it will not be propagated by the network")) return @@ -1296,7 +1294,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): msg.append( _("Additional fees") + ": " + self.format_amount_and_units(extra_fee) ) confirm_rate = 2 * self.config.max_fee_rate() - if tx.get_fee() > confirm_rate * tx.estimated_size() / 1000: + if fee > confirm_rate * tx.estimated_size() / 1000: msg.append(_('Warning') + ': ' + _("The fee for this transaction seems unusually high.")) if self.wallet.has_password():