Browse Source

RBF: make sure we know the fee for the old txn

related #4306
3.2.x
SomberNight 7 years ago
parent
commit
a161b6e655
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 3
      gui/kivy/uix/dialogs/tx_dialog.py
  2. 3
      gui/qt/history_list.py
  3. 3
      gui/qt/main_window.py

3
gui/kivy/uix/dialogs/tx_dialog.py

@ -135,6 +135,9 @@ class TxDialog(Factory.Popup):
def do_rbf(self): def do_rbf(self):
from .bump_fee_dialog import BumpFeeDialog from .bump_fee_dialog import BumpFeeDialog
is_relevant, is_mine, v, fee = self.wallet.get_wallet_delta(self.tx) 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() size = self.tx.estimated_size()
d = BumpFeeDialog(self.app, fee, size, self._do_rbf) d = BumpFeeDialog(self.app, fee, size, self._do_rbf)
d.open() d.open()

3
gui/qt/history_list.py

@ -345,7 +345,8 @@ class HistoryList(MyTreeWidget, AcceptFileDragDrop):
lambda bound_c=c: self.editItem(item, bound_c)) lambda bound_c=c: self.editItem(item, bound_c))
menu.addAction(_("Details"), lambda: self.parent.show_transaction(tx)) menu.addAction(_("Details"), lambda: self.parent.show_transaction(tx))
if is_unconfirmed and 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: if rbf:
menu.addAction(_("Increase fee"), lambda: self.parent.bump_fee_dialog(tx)) menu.addAction(_("Increase fee"), lambda: self.parent.bump_fee_dialog(tx))
else: else:

3
gui/qt/main_window.py

@ -3138,6 +3138,9 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
def bump_fee_dialog(self, tx): def bump_fee_dialog(self, tx):
is_relevant, is_mine, v, fee = self.wallet.get_wallet_delta(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_label = self.wallet.get_label(tx.txid())
tx_size = tx.estimated_size() tx_size = tx.estimated_size()
d = WindowModalDialog(self, _('Bump Fee')) d = WindowModalDialog(self, _('Bump Fee'))

Loading…
Cancel
Save