Improve comments
This commit is contained in:
parent
c715ae6249
commit
e568ee2488
@ -22,12 +22,12 @@ class Notifications(object):
|
|||||||
#
|
#
|
||||||
# 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
|
||||||
# time, and any mempool refreshes during that time will not have
|
# time, and the prefetcher might poll the daemon after the mempool
|
||||||
# the transaction in the mempool any more, which would cause a
|
# code in any case. In such cases the transaction will not be in
|
||||||
# redundant notification. To avoid this, mempool touches are not
|
# the mempool after the mempool refresh. We want to avoid
|
||||||
# notified whilst a block is being processed, but combined with
|
# notifying clients twice - for the mempool refresh and when the
|
||||||
# the block notification when it is made. We do not pause mempool
|
# block is done. This object handles that logic by deferring
|
||||||
# processing
|
# notifications appropriately.
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._touched_mp = {}
|
self._touched_mp = {}
|
||||||
@ -43,8 +43,8 @@ class Notifications(object):
|
|||||||
height = self._highest_block
|
height = self._highest_block
|
||||||
else:
|
else:
|
||||||
# Either we are processing a block and waiting for it to
|
# Either we are processing a block and waiting for it to
|
||||||
# come in, or we have had no mempool update for the
|
# come in, or we have not yet had a mempool update for the
|
||||||
# current block
|
# new block height
|
||||||
return
|
return
|
||||||
touched = tmp.pop(height)
|
touched = tmp.pop(height)
|
||||||
touched.update(tbp.pop(height, set()))
|
touched.update(tbp.pop(height, set()))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user