Browse Source

fix race in NetworkJobOnDefaultServer constructors

hard-fail-on-bad-server-string
ThomasV 5 years ago
parent
commit
2e4cfd0744
  1. 2
      electrum/lnverifier.py
  2. 2
      electrum/synchronizer.py

2
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()

2
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()

Loading…
Cancel
Save