qt: handle expected errors in DSCancelDialog
closes https://github.com/spesmilo/electrum/issues/8390
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user