Browse Source

lnworker: follow-up 89a14996ce

this fixes running with --offline:

E | gui.qt.exception_window.Exception_Hook | exception caught by crash reporter
Traceback (most recent call last):
  File "...\electrum\electrum\gui\qt\channels_list.py", line 241, in do_update_rows
    items = [QtGui.QStandardItem(x) for x in self.format_fields(chan)]
  File "...\electrum\electrum\gui\qt\channels_list.py", line 82, in format_fields
    node_alias = self.lnworker.get_node_alias(chan.node_id)
  File "...\electrum\electrum\lnworker.py", line 188, in get_node_alias
    if self.channel_db:
AttributeError: 'LNWallet' object has no attribute 'channel_db'
patch-4
SomberNight 4 years ago
parent
commit
08c3d2ccd0
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 8
      electrum/lnworker.py

8
electrum/lnworker.py

@ -78,6 +78,8 @@ from .submarine_swaps import SwapManager
if TYPE_CHECKING: if TYPE_CHECKING:
from .network import Network from .network import Network
from .wallet import Abstract_Wallet from .wallet import Abstract_Wallet
from .channel_db import ChannelDB
from .simple_config import SimpleConfig
SAVED_PR_STATUS = [PR_PAID, PR_UNPAID, PR_INFLIGHT] # status that are persisted SAVED_PR_STATUS = [PR_PAID, PR_UNPAID, PR_INFLIGHT] # status that are persisted
@ -173,6 +175,10 @@ class LNWorker(Logger, NetworkRetryManager[LNPeerAddr]):
self.features |= LnFeatures.VAR_ONION_OPT self.features |= LnFeatures.VAR_ONION_OPT
self.features |= LnFeatures.PAYMENT_SECRET_OPT self.features |= LnFeatures.PAYMENT_SECRET_OPT
self.network = None # type: Optional[Network]
self.config = None # type: Optional[SimpleConfig]
self.channel_db = None # type: Optional[ChannelDB]
util.register_callback(self.on_proxy_changed, ['proxy_set']) util.register_callback(self.on_proxy_changed, ['proxy_set'])
@property @property
@ -521,8 +527,8 @@ class LNWallet(LNWorker):
Logger.__init__(self) Logger.__init__(self)
self.wallet = wallet self.wallet = wallet
self.db = wallet.db self.db = wallet.db
self.config = wallet.config
LNWorker.__init__(self, xprv) LNWorker.__init__(self, xprv)
self.config = wallet.config
self.lnwatcher = None self.lnwatcher = None
self.lnrater: LNRater = None self.lnrater: LNRater = None
self.features |= LnFeatures.OPTION_DATA_LOSS_PROTECT_REQ self.features |= LnFeatures.OPTION_DATA_LOSS_PROTECT_REQ

Loading…
Cancel
Save