From f76e8b0a4441cfd53d18a8848110c4427297ab89 Mon Sep 17 00:00:00 2001 From: "John L. Jegutanis" Date: Thu, 13 Sep 2018 00:16:52 +0200 Subject: [PATCH] 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. --- electrumx/server/block_processor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/electrumx/server/block_processor.py b/electrumx/server/block_processor.py index 6fc4dff..c37eec2 100644 --- a/electrumx/server/block_processor.py +++ b/electrumx/server/block_processor.py @@ -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():