mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
core: prevent reverting valid section when reorg happens
This commit is contained in:
parent
48c9d284c1
commit
7f782b136e
1 changed files with 1 additions and 1 deletions
|
|
@ -243,7 +243,7 @@ func (c *ChainIndexer) newHead(head uint64, reorg bool) {
|
|||
// If a reorg happened, invalidate all sections until that point
|
||||
if reorg {
|
||||
// Revert the known section number to the reorg point
|
||||
known := head / c.sectionSize
|
||||
known := (head + 1) / c.sectionSize
|
||||
stored := known
|
||||
if known < c.checkpointSections {
|
||||
known = 0
|
||||
|
|
|
|||
Loading…
Reference in a new issue