Browse Source

Fix reorg assertion, I think

master
Neil Booth 8 years ago
parent
commit
a5b73560f3
  1. 3
      server/block_processor.py

3
server/block_processor.py

@ -294,7 +294,6 @@ class BlockProcessor(LoggedClass):
start = self.height - 1 start = self.height - 1
count = 1 count = 1
while start > 0: while start > 0:
self.logger.info('start: {:,d} count: {:,d}'.format(start, count))
hashes = self.fs_cache.block_hashes(start, count) hashes = self.fs_cache.block_hashes(start, count)
hex_hashes = [hash_to_str(hash) for hash in hashes] hex_hashes = [hash_to_str(hash) for hash in hashes]
d_hex_hashes = await self.daemon.block_hex_hashes(start, count) d_hex_hashes = await self.daemon.block_hex_hashes(start, count)
@ -582,12 +581,12 @@ class BlockProcessor(LoggedClass):
# the UTXO cache uses the fs_cache via get_tx_hash() to # the UTXO cache uses the fs_cache via get_tx_hash() to
# resolve compressed key collisions # resolve compressed key collisions
header, tx_hashes, txs = self.coin.read_block(block) header, tx_hashes, txs = self.coin.read_block(block)
self.fs_cache.advance_block(header, tx_hashes, txs)
prev_hash, header_hash = self.coin.header_hashes(header) prev_hash, header_hash = self.coin.header_hashes(header)
if prev_hash != self.tip: if prev_hash != self.tip:
return None return None
touched = set() touched = set()
self.fs_cache.advance_block(header, tx_hashes, txs)
self.tip = header_hash self.tip = header_hash
self.height += 1 self.height += 1
undo_info = self.advance_txs(tx_hashes, txs, touched) undo_info = self.advance_txs(tx_hashes, txs, touched)

Loading…
Cancel
Save