add lnworker in start_network

This commit is contained in:
ThomasV 2018-09-23 17:43:51 +02:00 committed by SomberNight
parent 356149cd52
commit dd35a5d0a0
No known key found for this signature in database
GPG key ID: B33B5F232C6271E9
2 changed files with 5 additions and 2 deletions

View file

@ -44,7 +44,6 @@ from .commands import known_commands, Commands
from .simple_config import SimpleConfig from .simple_config import SimpleConfig
from .exchange_rate import FxThread from .exchange_rate import FxThread
from .plugin import run_hook from .plugin import run_hook
from .lnworker import LNWorker
def get_lockfile(config: SimpleConfig): def get_lockfile(config: SimpleConfig):
return os.path.join(config.path, 'daemon') return os.path.join(config.path, 'daemon')
@ -251,7 +250,6 @@ class Daemon(DaemonThread):
return return
wallet = Wallet(storage) wallet = Wallet(storage)
wallet.start_network(self.network) wallet.start_network(self.network)
wallet.lnworker = LNWorker(wallet, self.network)
self.wallets[path] = wallet self.wallets[path] = wallet
return wallet return wallet

View file

@ -60,6 +60,7 @@ from .paymentrequest import (PR_PAID, PR_UNPAID, PR_UNKNOWN, PR_EXPIRED,
InvoiceStore) InvoiceStore)
from .contacts import Contacts from .contacts import Contacts
from .interface import RequestTimedOut from .interface import RequestTimedOut
from .lnworker import LNWorker
if TYPE_CHECKING: if TYPE_CHECKING:
from .network import Network from .network import Network
@ -183,6 +184,10 @@ class Abstract_Wallet(AddressSynchronizer):
self.coin_price_cache = {} self.coin_price_cache = {}
def start_network(self, network):
AddressSynchronizer.start_network(self, network)
self.lnworker = LNWorker(self, network)
def load_and_cleanup(self): def load_and_cleanup(self):
self.load_keystore() self.load_keystore()
self.load_addresses() self.load_addresses()