From e568ee2488e03b7c5d0e7196a4ba0dd51ce4fe71 Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Sat, 21 Jul 2018 20:51:35 +0800 Subject: [PATCH] Improve comments --- electrumx/server/controller.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/electrumx/server/controller.py b/electrumx/server/controller.py index c182d1e..d126e5d 100644 --- a/electrumx/server/controller.py +++ b/electrumx/server/controller.py @@ -22,12 +22,12 @@ class Notifications(object): # # A user with a pending transaction is notified after the block it # gets in is processed. Block processing can take an extended - # time, and any mempool refreshes during that time will not have - # the transaction in the mempool any more, which would cause a - # redundant notification. To avoid this, mempool touches are not - # notified whilst a block is being processed, but combined with - # the block notification when it is made. We do not pause mempool - # processing + # time, and the prefetcher might poll the daemon after the mempool + # code in any case. In such cases the transaction will not be in + # the mempool after the mempool refresh. We want to avoid + # notifying clients twice - for the mempool refresh and when the + # block is done. This object handles that logic by deferring + # notifications appropriately. def __init__(self): self._touched_mp = {} @@ -43,8 +43,8 @@ class Notifications(object): height = self._highest_block else: # Either we are processing a block and waiting for it to - # come in, or we have had no mempool update for the - # current block + # come in, or we have not yet had a mempool update for the + # new block height return touched = tmp.pop(height) touched.update(tbp.pop(height, set()))