Simplify refresh hashes loop
This commit is contained in:
parent
821f907971
commit
4da95dd853
@ -56,15 +56,13 @@ class MemPool(object):
|
||||
await self._synchronize(False)
|
||||
|
||||
async def _refresh_hashes(self):
|
||||
'''Return daemon hashes when we're sure which height they are
|
||||
good for.'''
|
||||
height = self.daemon.cached_height()
|
||||
'''Return a (hash set, height) pair when we're sure which height they
|
||||
are for.'''
|
||||
while True:
|
||||
height = self.daemon.cached_height()
|
||||
hashes = await self.daemon.mempool_hashes()
|
||||
later_height = await self.daemon.height()
|
||||
if height == later_height:
|
||||
if height == await self.daemon.height():
|
||||
return set(hashes), height
|
||||
height = later_height
|
||||
|
||||
async def _synchronize(self, first_time):
|
||||
'''Asynchronously maintain mempool status with daemon.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user