@ -382,8 +382,9 @@ class BlockProcessor(server.db.DB):
while True:
await self._wait_for_update()
await asyncio.sleep(0) # Yield
finally:
except asyncio.CancelledError:
self.flush(True)
raise
async def _wait_for_update(self):
'''Wait for the prefetcher to deliver blocks or a mempool update.
@ -119,7 +119,6 @@ class DB(LoggedClass):
if tx_height > self.db_height:
return None, tx_height
raise self.DBError('tx_num {:,d} is not on disk')
file_pos = tx_num * 32
file_num, offset = divmod(file_pos, self.tx_hash_file_size)