Browse Source

[DashElectrumX] prevent size change of self.mns (#739)

send_notification adds the retreived collateral to self.mns during masternode.subscribe, this can issue a runtime error because size of self.mns changes during iteration.
Reproduce: issue multiple masternode.subscribe (with valid and invalid collaterals) during the same session.
patch-2
konez2k 6 years ago
committed by Neil
parent
commit
24008f3111
  1. 2
      electrumx/server/session.py

2
electrumx/server/session.py

@ -1319,7 +1319,7 @@ class DashElectrumX(ElectrumX):
async def notify(self, touched, height_changed):
'''Notify the client about changes in masternode list.'''
await super().notify(touched, height_changed)
for mn in self.mns:
for mn in self.mns.copy():
status = await self.daemon_request('masternode_list',
['status', mn])
await self.send_notification('masternode.subscribe',

Loading…
Cancel
Save