From bb21e0182354da0e1685b5b9bb34acc8f4483786 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Fri, 14 Feb 2020 14:15:15 +0100 Subject: [PATCH] (minor) call lnwatcher.add_channel from lnworker.add_channel --- electrum/lnpeer.py | 1 - electrum/lnworker.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/electrum/lnpeer.py b/electrum/lnpeer.py index b6f0402d8..cc9d6e36e 100644 --- a/electrum/lnpeer.py +++ b/electrum/lnpeer.py @@ -691,7 +691,6 @@ class Peer(Logger): ) chan.open_with_first_pcp(payload['first_per_commitment_point'], remote_sig) self.lnworker.add_channel(chan) - self.lnworker.lnwatcher.add_channel(chan.funding_outpoint.to_str(), chan.get_funding_address()) def validate_remote_reserve(self, payload_field: bytes, dust_limit: int, funding_sat: int) -> int: remote_reserve_sat = int.from_bytes(payload_field, 'big') diff --git a/electrum/lnworker.py b/electrum/lnworker.py index ef61149e0..49cba4f93 100644 --- a/electrum/lnworker.py +++ b/electrum/lnworker.py @@ -830,7 +830,6 @@ class LNWallet(LNWorker): push_msat=push_sat * 1000, temp_channel_id=os.urandom(32)) self.add_channel(chan) - self.lnwatcher.add_channel(chan.funding_outpoint.to_str(), chan.get_funding_address()) self.network.trigger_callback('channels_updated', self.wallet) self.wallet.add_transaction(funding_tx) # save tx as local into the wallet self.wallet.set_label(funding_tx.txid(), _('Open channel')) @@ -842,6 +841,7 @@ class LNWallet(LNWorker): def add_channel(self, chan): with self.lock: self.channels[chan.channel_id] = chan + self.lnwatcher.add_channel(chan.funding_outpoint.to_str(), chan.get_funding_address()) @log_exceptions async def add_peer(self, connect_str: str) -> Peer: