aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/chain_indexer.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/chain_indexer.go b/core/chain_indexer.go
index 26538260c..80062714a 100644
--- a/core/chain_indexer.go
+++ b/core/chain_indexer.go
@@ -128,12 +128,13 @@ func (c *ChainIndexer) AddCheckpoint(section uint64, shead common.Hash) {
c.lock.Lock()
defer c.lock.Unlock()
+ // Short circuit if the given checkpoint is below than local's.
+ if c.checkpointSections >= section+1 || section < c.storedSections {
+ return
+ }
c.checkpointSections = section + 1
c.checkpointHead = shead
- if section < c.storedSections {
- return
- }
c.setSectionHead(section, shead)
c.setValidSections(section + 1)
}