Browse Source

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.
patch-2
John L. Jegutanis 7 years ago
committed by Neil
parent
commit
f76e8b0a44
  1. 4
      electrumx/server/block_processor.py

4
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():

Loading…
Cancel
Save