fix unwinding readers during reorg

This commit is contained in:
Jack Robison 2022-01-17 11:47:39 -05:00
parent f0f8ef044b
commit 81458b75e4
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -55,7 +55,7 @@ class BlockchainReader:
self.unwind() self.unwind()
last_height -= 1 last_height -= 1
self.db.read_db_state() self.db.read_db_state()
if not self.last_state or self.last_state.height < state.height: if not self.last_state or last_height < state.height:
for height in range(last_height + 1, state.height + 1): for height in range(last_height + 1, state.height + 1):
self.log.info("advancing to %i", height) self.log.info("advancing to %i", height)
self.advance(height) self.advance(height)