Fix reorg related bug (#594)

Changed to the correct self.db.read_raw_block and catch only
FileNotFoundError as it is the only one that should happen.
This commit is contained in:
John L. Jegutanis 2018-09-13 00:16:52 +02:00 committed by Neil
parent 95ea557b1d
commit f76e8b0a44

View File

@ -240,10 +240,10 @@ class BlockProcessor(object):
async def get_raw_blocks(last_height, hex_hashes):
heights = range(last_height, last_height - len(hex_hashes), -1)
try:
blocks = [self.read_raw_block(height) for height in heights]
blocks = [self.db.read_raw_block(height) for height in heights]
self.logger.info(f'read {len(blocks)} blocks from disk')
return blocks
except Exception:
except FileNotFoundError:
return await self.daemon.raw_blocks(hex_hashes)
def flush_backup():