Log immediately if mempool shrinks
This commit is contained in:
parent
c2703c58a3
commit
e651530e5d
@ -167,7 +167,7 @@ class MemPool(LoggedClass):
|
|||||||
self.txs = {}
|
self.txs = {}
|
||||||
self.hash168s = defaultdict(set) # None can be a key
|
self.hash168s = defaultdict(set) # None can be a key
|
||||||
self.bp = bp
|
self.bp = bp
|
||||||
self.count = 0
|
self.count = -1
|
||||||
|
|
||||||
async def update(self, hex_hashes):
|
async def update(self, hex_hashes):
|
||||||
'''Update state given the current mempool to the passed set of hashes.
|
'''Update state given the current mempool to the passed set of hashes.
|
||||||
@ -178,7 +178,7 @@ class MemPool(LoggedClass):
|
|||||||
hex_hashes = set(hex_hashes)
|
hex_hashes = set(hex_hashes)
|
||||||
touched = set()
|
touched = set()
|
||||||
|
|
||||||
if self.count == 0:
|
if self.count < 0:
|
||||||
self.logger.info('initial fetch of {:,d} daemon mempool txs'
|
self.logger.info('initial fetch of {:,d} daemon mempool txs'
|
||||||
.format(len(hex_hashes)))
|
.format(len(hex_hashes)))
|
||||||
|
|
||||||
@ -251,10 +251,11 @@ class MemPool(LoggedClass):
|
|||||||
self.hash168s[hash168].add(hex_hash)
|
self.hash168s[hash168].add(hex_hash)
|
||||||
touched.add(hash168)
|
touched.add(hash168)
|
||||||
|
|
||||||
if self.count % 20 == 0:
|
self.count += 1
|
||||||
|
if self.count % 25 == 0 or gone:
|
||||||
|
self.count = 0
|
||||||
self.logger.info('{:,d} txs touching {:,d} addresses'
|
self.logger.info('{:,d} txs touching {:,d} addresses'
|
||||||
.format(len(self.txs), len(self.hash168s)))
|
.format(len(self.txs), len(self.hash168s)))
|
||||||
self.count += 1
|
|
||||||
|
|
||||||
# Might include a None
|
# Might include a None
|
||||||
return touched
|
return touched
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user