diff --git a/electrum/gui/qt/main_window.py b/electrum/gui/qt/main_window.py index 809b754df..efb46f33c 100644 --- a/electrum/gui/qt/main_window.py +++ b/electrum/gui/qt/main_window.py @@ -2178,7 +2178,6 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger): 'wallet': self.wallet, 'network': self.network, 'plugins': self.gui_object.plugins, - 'lightning' : self.wallet.lnworker.console_interface, 'window': self, 'config': self.config, 'electrum': electrum, diff --git a/electrum/lnbase.py b/electrum/lnbase.py index 81b2fe3ec..1b0ecafad 100644 --- a/electrum/lnbase.py +++ b/electrum/lnbase.py @@ -32,12 +32,12 @@ from .lnutil import (Outpoint, LocalConfig, ChannelConfig, secret_to_pubkey, LNPeerAddr, PaymentFailure, LnLocalFeatures, LOCAL, REMOTE, HTLCOwner, generate_keypair, LnKeyFamily, get_ln_flag_pair_of_bit, privkey_to_pubkey, UnknownPaymentHash, MIN_FINAL_CLTV_EXPIRY_ACCEPTED, - LightningPeerConnectionClosed, HandshakeFailed, LNPeerAddr) -from .lnrouter import NotFoundChanAnnouncementForUpdate, RouteEdge + LightningPeerConnectionClosed, HandshakeFailed, LNPeerAddr, NotFoundChanAnnouncementForUpdate) from .lntransport import LNTransport, LNTransportBase if TYPE_CHECKING: from .lnworker import LNWorker + from .lnrouter import RouteEdge def channel_id_from_funding_tx(funding_txid: str, funding_index: int) -> Tuple[bytes, bytes]: @@ -908,7 +908,7 @@ class Peer(PrintError): await self.receive_revoke(chan) self.network.trigger_callback('ln_message', self.lnworker, 'Payment failed') - async def _handle_error_code_from_failed_htlc(self, error_reason, route: List[RouteEdge], channel_id, htlc_id): + async def _handle_error_code_from_failed_htlc(self, error_reason, route: List['RouteEdge'], channel_id, htlc_id): chan = self.channels[channel_id] failure_msg, sender_idx = decode_onion_error(error_reason, [x.node_id for x in route], @@ -962,7 +962,7 @@ class Peer(PrintError): await self.receive_commitment(chan) self.revoke(chan) - async def pay(self, route: List[RouteEdge], chan: Channel, amount_msat: int, + async def pay(self, route: List['RouteEdge'], chan: Channel, amount_msat: int, payment_hash: bytes, min_final_cltv_expiry: int): assert chan.get_state() == "OPEN", chan.get_state() assert amount_msat > 0, "amount_msat is not greater zero" diff --git a/electrum/lnrouter.py b/electrum/lnrouter.py index 974540d23..12ce6e3b6 100644 --- a/electrum/lnrouter.py +++ b/electrum/lnrouter.py @@ -39,7 +39,8 @@ from .storage import JsonDB from .lnchannelverifier import LNChannelVerifier, verify_sig_for_channel_update from .crypto import sha256d from . import ecc -from .lnutil import LN_GLOBAL_FEATURES_KNOWN_SET, LNPeerAddr, NUM_MAX_EDGES_IN_PAYMENT_PATH +from .lnutil import (LN_GLOBAL_FEATURES_KNOWN_SET, LNPeerAddr, NUM_MAX_EDGES_IN_PAYMENT_PATH, + NotFoundChanAnnouncementForUpdate) if TYPE_CHECKING: from .lnchan import Channel @@ -49,8 +50,6 @@ if TYPE_CHECKING: class UnknownEvenFeatureBits(Exception): pass -class NotFoundChanAnnouncementForUpdate(Exception): pass - class ChannelInfo(PrintError): diff --git a/electrum/lnutil.py b/electrum/lnutil.py index 3b1bec8da..d46ba2512 100644 --- a/electrum/lnutil.py +++ b/electrum/lnutil.py @@ -72,6 +72,8 @@ class ConnStringFormatError(LightningError): pass class UnknownPaymentHash(LightningError): pass class RemoteMisbehaving(LightningError): pass +class NotFoundChanAnnouncementForUpdate(Exception): pass + # TODO make configurable? MIN_FINAL_CLTV_EXPIRY_ACCEPTED = 144