Browse Source

qt: handle expected errors in DSCancelDialog

closes https://github.com/spesmilo/electrum/issues/8390
master
SomberNight 3 years ago
parent
commit
9c47144418
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
  1. 4
      electrum/gui/qt/rbf_dialog.py
  2. 6
      electrum/wallet.py

4
electrum/gui/qt/rbf_dialog.py

@ -15,7 +15,7 @@ from .util import (ColorScheme, WindowModalDialog, Buttons,
from electrum.i18n import _
from electrum.transaction import PartialTransaction
from electrum.wallet import CannotBumpFee
from electrum.wallet import CannotRBFTx
if TYPE_CHECKING:
from .main_window import ElectrumWindow
@ -124,7 +124,7 @@ class _BaseRBFDialog(TxEditor):
else:
try:
self.tx = self.make_tx(fee_rate)
except CannotBumpFee as e:
except CannotRBFTx as e:
self.tx = None
self.error = str(e)

6
electrum/wallet.py

@ -225,12 +225,14 @@ def get_locktime_for_new_transaction(network: 'Network') -> int:
return locktime
class CannotRBFTx(Exception): pass
class CannotBumpFee(Exception):
class CannotBumpFee(CannotRBFTx):
def __str__(self):
return _('Cannot bump fee') + ':\n\n' + Exception.__str__(self)
class CannotDoubleSpendTx(Exception):
class CannotDoubleSpendTx(CannotRBFTx):
def __str__(self):
return _('Cannot cancel transaction') + ':\n\n' + Exception.__str__(self)

Loading…
Cancel
Save