mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
core/filtermaps: check chain view consistency in makeSnapshot
This commit is contained in:
parent
cdaa79ada1
commit
500497319e
1 changed files with 3 additions and 3 deletions
|
|
@ -256,14 +256,14 @@ func (f *FilterMaps) loadHeadSnapshot() error {
|
||||||
|
|
||||||
// makeSnapshot creates a snapshot of the current state of the rendered map.
|
// makeSnapshot creates a snapshot of the current state of the rendered map.
|
||||||
func (r *mapRenderer) makeSnapshot() {
|
func (r *mapRenderer) makeSnapshot() {
|
||||||
if r.iterator.blockNumber != r.currentMap.lastBlock {
|
if r.iterator.blockNumber != r.currentMap.lastBlock || r.iterator.chainView != r.f.targetView {
|
||||||
panic("iterator state inconsistent with last block")
|
panic("iterator state inconsistent with current rendered map")
|
||||||
}
|
}
|
||||||
r.f.renderSnapshots.Add(r.currentMap.lastBlock, &renderedMap{
|
r.f.renderSnapshots.Add(r.currentMap.lastBlock, &renderedMap{
|
||||||
filterMap: r.currentMap.filterMap.fastCopy(),
|
filterMap: r.currentMap.filterMap.fastCopy(),
|
||||||
mapIndex: r.currentMap.mapIndex,
|
mapIndex: r.currentMap.mapIndex,
|
||||||
lastBlock: r.currentMap.lastBlock,
|
lastBlock: r.currentMap.lastBlock,
|
||||||
lastBlockId: r.f.targetView.getBlockId(r.currentMap.lastBlock),
|
lastBlockId: r.iterator.chainView.getBlockId(r.currentMap.lastBlock),
|
||||||
blockLvPtrs: r.currentMap.blockLvPtrs,
|
blockLvPtrs: r.currentMap.blockLvPtrs,
|
||||||
finished: true,
|
finished: true,
|
||||||
headDelimiter: r.iterator.lvIndex,
|
headDelimiter: r.iterator.lvIndex,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue