1
0

qt: handle expected errors in DSCancelDialog

closes https://github.com/spesmilo/electrum/issues/8390
This commit is contained in:
SomberNight
2023-05-05 16:06:16 +00:00
parent 3020499199
commit 9c47144418
2 changed files with 6 additions and 4 deletions

View File

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

View File

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