From 2e4cfd07445bc3f38090fdb3cd52612a55470469 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Fri, 6 Dec 2019 20:17:52 +0100 Subject: [PATCH] fix race in NetworkJobOnDefaultServer constructors --- electrum/lnverifier.py | 2 +- electrum/synchronizer.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/electrum/lnverifier.py b/electrum/lnverifier.py index 3d028363e..90d0045e8 100644 --- a/electrum/lnverifier.py +++ b/electrum/lnverifier.py @@ -53,12 +53,12 @@ class LNChannelVerifier(NetworkJobOnDefaultServer): # spread it over multiple servers. def __init__(self, network: 'Network', channel_db: 'ChannelDB'): - NetworkJobOnDefaultServer.__init__(self, network) self.channel_db = channel_db self.lock = threading.Lock() self.unverified_channel_info = {} # type: Dict[ShortChannelID, dict] # scid -> msg_payload # channel announcements that seem to be invalid: self.blacklist = set() # type: Set[ShortChannelID] + NetworkJobOnDefaultServer.__init__(self, network) def _reset(self): super()._reset() diff --git a/electrum/synchronizer.py b/electrum/synchronizer.py index d01faaad3..d00fda870 100644 --- a/electrum/synchronizer.py +++ b/electrum/synchronizer.py @@ -60,8 +60,8 @@ class SynchronizerBase(NetworkJobOnDefaultServer): """ def __init__(self, network: 'Network'): self.asyncio_loop = network.asyncio_loop - NetworkJobOnDefaultServer.__init__(self, network) self._reset_request_counters() + NetworkJobOnDefaultServer.__init__(self, network) def _reset(self): super()._reset()