tfix race in check_onchain_situation - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 72f4e833333d251d179984a707724e6ca51e3208 DIR parent b90cbeb0ba144db0f663d374cbebcbff3bf788dc HTML Author: ThomasV <thomasv@electrum.org> Date: Tue, 18 Feb 2020 17:06:54 +0100 fix race in check_onchain_situation Diffstat: M electrum/lnwatcher.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- DIR diff --git a/electrum/lnwatcher.py b/electrum/lnwatcher.py t@@ -170,13 +170,14 @@ class LNWatcher(AddressSynchronizer): if not self.synchronizer: self.logger.info("synchronizer not set yet") return - if not self.up_to_date: - return for address, outpoint in self.channels.items(): await self.check_onchain_situation(address, outpoint) async def check_onchain_situation(self, address, funding_outpoint): spenders = self.inspect_tx_candidate(funding_outpoint, 0) + # inspect_tx_candidate might have added new addresses, in which case we return ealy + if not self.is_up_to_date(): + return funding_txid = funding_outpoint.split(':')[0] funding_height = self.get_tx_height(funding_txid) closing_txid = spenders.get(funding_outpoint)