diff --git a/blockmanager.go b/blockmanager.go index 57cae6cd..bcadd2fe 100644 --- a/blockmanager.go +++ b/blockmanager.go @@ -548,7 +548,12 @@ func (b *blockManager) handleBlockMsg(bmsg *blockMsg) { if !b.blockChain.IsKnownOrphan(blockSha) { delete(b.blockPeer, *blockSha) b.logBlockHeight(bmsg.block) - b.updateChainState(blockSha, bmsg.block.Height()) + + // Query the db for the latest best block since the block + // that was processed could be on a side chain or have caused + // a reorg. + newestSha, newestHeight, _ := b.server.db.NewestSha() + b.updateChainState(newestSha, newestHeight) } // Sync the db to disk.