Use a list for order
This commit is contained in:
parent
e5b2268387
commit
790d462b55
@ -19,8 +19,7 @@ from electrumx.server.session import SessionManager
|
|||||||
|
|
||||||
class Notifications(object):
|
class Notifications(object):
|
||||||
# hashX notifications come from two sources: new blocks and
|
# hashX notifications come from two sources: new blocks and
|
||||||
# mempool refreshes. The logic in daemon.py only gets new mempool
|
# mempool refreshes.
|
||||||
# hashes after getting the latest height.
|
|
||||||
#
|
#
|
||||||
# A user with a pending transaction is notified after the block it
|
# A user with a pending transaction is notified after the block it
|
||||||
# gets in is processed. Block processing can take an extended
|
# gets in is processed. Block processing can take an extended
|
||||||
@ -35,7 +34,7 @@ class Notifications(object):
|
|||||||
self._touched_mp = {}
|
self._touched_mp = {}
|
||||||
self._touched_bp = {}
|
self._touched_bp = {}
|
||||||
self._highest_block = 0
|
self._highest_block = 0
|
||||||
self._notify_funcs = set()
|
self._notify_funcs = []
|
||||||
|
|
||||||
async def _maybe_notify(self):
|
async def _maybe_notify(self):
|
||||||
tmp, tbp = self._touched_mp, self._touched_bp
|
tmp, tbp = self._touched_mp, self._touched_bp
|
||||||
@ -59,7 +58,7 @@ class Notifications(object):
|
|||||||
await notify_func(height, touched)
|
await notify_func(height, touched)
|
||||||
|
|
||||||
def add_callback(self, notify_func):
|
def add_callback(self, notify_func):
|
||||||
self._notify_funcs.add(notify_func)
|
self._notify_funcs.append(notify_func)
|
||||||
|
|
||||||
async def on_mempool(self, touched, height):
|
async def on_mempool(self, touched, height):
|
||||||
self._touched_mp[height] = touched
|
self._touched_mp[height] = touched
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user