Browse Source

Fix rare race condition

Closes #567
patch-2
Neil Booth 7 years ago
parent
commit
afae1b4a42
  1. 6
      electrumx/server/session.py

6
electrumx/server/session.py

@ -670,8 +670,10 @@ class ElectrumX(SessionBase):
# Check mempool hashXs - the status is a function of the
# confirmed state of other transactions. Note: we cannot
# iterate over mempool_statuses as it changes size.
for hashX in set(self.mempool_statuses):
old_status = self.mempool_statuses[hashX]
for hashX in tuple(self.mempool_statuses):
# Items can be evicted whilst await-ing below; False
# ensures such hashXs are notified
old_status = self.mempool_statuses.get(hashX, False)
status = await self.address_status(hashX)
if status != old_status:
alias = self.hashX_subs[hashX]

Loading…
Cancel
Save