From 3d23363fb165edd13aeca9c7be0dbf9c4bcd0e52 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Mon, 6 May 2019 12:26:53 +0200 Subject: [PATCH] wallet: add lnworker in constructor for CLI --- electrum/wallet.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/electrum/wallet.py b/electrum/wallet.py index 639a96ee2..c71405d16 100644 --- a/electrum/wallet.py +++ b/electrum/wallet.py @@ -45,6 +45,7 @@ from .util import (NotEnoughFunds, UserCancelled, profiler, WalletFileException, BitcoinException, InvalidPassword, format_time, timestamp_to_datetime, Satoshis, Fiat, bfh, bh2u, TxMinedInfo) +from .simple_config import get_config from .bitcoin import (COIN, TYPE_ADDRESS, is_address, address_to_script, is_minikey, relayfee, dust_threshold) from .crypto import sha256d @@ -229,16 +230,15 @@ class Abstract_Wallet(AddressSynchronizer): if self.storage.get('wallet_type') is None: self.storage.put('wallet_type', self.wallet_type) - self.lnworker = None # invoices and contacts self.invoices = InvoiceStore(self.storage) self.contacts = Contacts(self.storage) self._coin_price_cache = {} + self.lnworker = LNWallet(self) if get_config().get('lightning') else None def start_network(self, network): AddressSynchronizer.start_network(self, network) - if network.config.get('lightning'): - self.lnworker = LNWallet(self) + if self.lnworker: self.lnworker.start_network(network) def load_and_cleanup(self):