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:
parent
78c404efdf
commit
5b7dfa7e11
@ -240,10 +240,10 @@ class BlockProcessor(object):
|
|||||||
async def get_raw_blocks(last_height, hex_hashes):
|
async def get_raw_blocks(last_height, hex_hashes):
|
||||||
heights = range(last_height, last_height - len(hex_hashes), -1)
|
heights = range(last_height, last_height - len(hex_hashes), -1)
|
||||||
try:
|
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')
|
self.logger.info(f'read {len(blocks)} blocks from disk')
|
||||||
return blocks
|
return blocks
|
||||||
except Exception:
|
except FileNotFoundError:
|
||||||
return await self.daemon.raw_blocks(hex_hashes)
|
return await self.daemon.raw_blocks(hex_hashes)
|
||||||
|
|
||||||
def flush_backup():
|
def flush_backup():
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user