From a161b6e6556dab35e01ab2607f8a9332d7db2c75 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Tue, 24 Apr 2018 15:30:13 +0200 Subject: [PATCH] RBF: make sure we know the fee for the old txn related #4306 --- gui/kivy/uix/dialogs/tx_dialog.py | 3 +++ gui/qt/history_list.py | 3 ++- gui/qt/main_window.py | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gui/kivy/uix/dialogs/tx_dialog.py b/gui/kivy/uix/dialogs/tx_dialog.py index fbbdf0a27..6b263852b 100644 --- a/gui/kivy/uix/dialogs/tx_dialog.py +++ b/gui/kivy/uix/dialogs/tx_dialog.py @@ -135,6 +135,9 @@ class TxDialog(Factory.Popup): def do_rbf(self): from .bump_fee_dialog import BumpFeeDialog is_relevant, is_mine, v, fee = self.wallet.get_wallet_delta(self.tx) + if fee is None: + self.app.show_error(_("Can't bump fee: unknown fee for original transaction.")) + return size = self.tx.estimated_size() d = BumpFeeDialog(self.app, fee, size, self._do_rbf) d.open() diff --git a/gui/qt/history_list.py b/gui/qt/history_list.py index 57e8c87fd..efe176d88 100644 --- a/gui/qt/history_list.py +++ b/gui/qt/history_list.py @@ -345,7 +345,8 @@ class HistoryList(MyTreeWidget, AcceptFileDragDrop): lambda bound_c=c: self.editItem(item, bound_c)) menu.addAction(_("Details"), lambda: self.parent.show_transaction(tx)) if is_unconfirmed and tx: - rbf = is_mine and not tx.is_final() + # note: the current implementation of RBF *needs* the old tx fee + rbf = is_mine and not tx.is_final() and fee is not None if rbf: menu.addAction(_("Increase fee"), lambda: self.parent.bump_fee_dialog(tx)) else: diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py index 3f381cfeb..befa28b7c 100644 --- a/gui/qt/main_window.py +++ b/gui/qt/main_window.py @@ -3138,6 +3138,9 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): def bump_fee_dialog(self, tx): is_relevant, is_mine, v, fee = self.wallet.get_wallet_delta(tx) + if fee is None: + self.show_error(_("Can't bump fee: unknown fee for original transaction.")) + return tx_label = self.wallet.get_label(tx.txid()) tx_size = tx.estimated_size() d = WindowModalDialog(self, _('Bump Fee'))