Skip to content

Commit f76e8b0

Browse files
erasmospunkNeil
authored andcommitted
Fix reorg related bug (kyuupichan#594)
Changed to the correct self.db.read_raw_block and catch only FileNotFoundError as it is the only one that should happen.
1 parent 95ea557 commit f76e8b0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

electrumx/server/block_processor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,10 @@ async def reorg_chain(self, count=None):
240240
async def get_raw_blocks(last_height, hex_hashes):
241241
heights = range(last_height, last_height - len(hex_hashes), -1)
242242
try:
243-
blocks = [self.read_raw_block(height) for height in heights]
243+
blocks = [self.db.read_raw_block(height) for height in heights]
244244
self.logger.info(f'read {len(blocks)} blocks from disk')
245245
return blocks
246-
except Exception:
246+
except FileNotFoundError:
247247
return await self.daemon.raw_blocks(hex_hashes)
248248

249249
def flush_backup():

0 commit comments

Comments
 (0)