From 790d462b55a61bc3b714040b5f0204171f2c3cc3 Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Mon, 6 Aug 2018 11:59:55 +0900 Subject: [PATCH] Use a list for order --- electrumx/server/controller.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/electrumx/server/controller.py b/electrumx/server/controller.py index 8dc6b0d..051bed2 100644 --- a/electrumx/server/controller.py +++ b/electrumx/server/controller.py @@ -19,8 +19,7 @@ from electrumx.server.session import SessionManager class Notifications(object): # hashX notifications come from two sources: new blocks and - # mempool refreshes. The logic in daemon.py only gets new mempool - # hashes after getting the latest height. + # mempool refreshes. # # A user with a pending transaction is notified after the block it # gets in is processed. Block processing can take an extended @@ -35,7 +34,7 @@ class Notifications(object): self._touched_mp = {} self._touched_bp = {} self._highest_block = 0 - self._notify_funcs = set() + self._notify_funcs = [] async def _maybe_notify(self): tmp, tbp = self._touched_mp, self._touched_bp @@ -59,7 +58,7 @@ class Notifications(object): await notify_func(height, touched) 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): self._touched_mp[height] = touched