From 500497319e0a796b5d16c81ad3e7f5d3d0e66407 Mon Sep 17 00:00:00 2001 From: Zsolt Felfoldi Date: Wed, 16 Apr 2025 09:51:36 +0200 Subject: [PATCH] core/filtermaps: check chain view consistency in makeSnapshot --- core/filtermaps/map_renderer.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/filtermaps/map_renderer.go b/core/filtermaps/map_renderer.go index b03c4f3302..cd960ad31c 100644 --- a/core/filtermaps/map_renderer.go +++ b/core/filtermaps/map_renderer.go @@ -256,14 +256,14 @@ func (f *FilterMaps) loadHeadSnapshot() error { // makeSnapshot creates a snapshot of the current state of the rendered map. func (r *mapRenderer) makeSnapshot() { - if r.iterator.blockNumber != r.currentMap.lastBlock { - panic("iterator state inconsistent with last block") + if r.iterator.blockNumber != r.currentMap.lastBlock || r.iterator.chainView != r.f.targetView { + panic("iterator state inconsistent with current rendered map") } r.f.renderSnapshots.Add(r.currentMap.lastBlock, &renderedMap{ filterMap: r.currentMap.filterMap.fastCopy(), mapIndex: r.currentMap.mapIndex, lastBlock: r.currentMap.lastBlock, - lastBlockId: r.f.targetView.getBlockId(r.currentMap.lastBlock), + lastBlockId: r.iterator.chainView.getBlockId(r.currentMap.lastBlock), blockLvPtrs: r.currentMap.blockLvPtrs, finished: true, headDelimiter: r.iterator.lvIndex,