From 3ddb83fad390396c5206764cf2f565e7d917afb9 Mon Sep 17 00:00:00 2001 From: bitromortac Date: Fri, 19 Feb 2021 09:27:28 +0100 Subject: [PATCH] lnworker: move NoPathFound to lnutil --- electrum/lnutil.py | 3 +++ electrum/lnworker.py | 8 ++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/electrum/lnutil.py b/electrum/lnutil.py index f97b81b0e..39567f242 100644 --- a/electrum/lnutil.py +++ b/electrum/lnutil.py @@ -290,6 +290,9 @@ class UpfrontShutdownScriptViolation(RemoteMisbehaving): pass class NotFoundChanAnnouncementForUpdate(Exception): pass class PaymentFailure(UserFacingException): pass +class NoPathFound(PaymentFailure): + def __str__(self): + return _('No path found') # TODO make some of these values configurable? REDEEM_AFTER_DOUBLE_SPENT_DELAY = 30 diff --git a/electrum/lnworker.py b/electrum/lnworker.py index 61e379a54..120c83026 100644 --- a/electrum/lnworker.py +++ b/electrum/lnworker.py @@ -56,7 +56,8 @@ from .lnutil import (Outpoint, LNPeerAddr, MIN_FINAL_CLTV_EXPIRY_FOR_INVOICE, NUM_MAX_EDGES_IN_PAYMENT_PATH, SENT, RECEIVED, HTLCOwner, UpdateAddHtlc, Direction, LnFeatures, ShortChannelID, - HtlcLog, derive_payment_secret_from_payment_preimage) + HtlcLog, derive_payment_secret_from_payment_preimage, + NoPathFound) from .lnutil import ln_dummy_address, ln_compare_features, IncompatibleLightningFeatures from .lnrouter import TrampolineEdge from .transaction import PartialTxOutput, PartialTransaction, PartialTxInput @@ -199,11 +200,6 @@ class PaymentInfo(NamedTuple): status: int -class NoPathFound(PaymentFailure): - def __str__(self): - return _('No path found') - - class ErrorAddingPeer(Exception): pass