aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorgary rong <garyrong0905@gmail.com>2019-06-28 15:34:02 +0800
committerPéter Szilágyi <peterke@gmail.com>2019-06-28 15:34:02 +0800
commitf7cdea2bdcd7ff3cec99731cb912cde0b233d6c9 (patch)
treeb463c8dd42547edceb778d946927d2c363303324 /core
parent702f52fb99d60b4b6bab05799c14dafdd8648854 (diff)
downloadgo-tangerine-f7cdea2bdcd7ff3cec99731cb912cde0b233d6c9.tar
go-tangerine-f7cdea2bdcd7ff3cec99731cb912cde0b233d6c9.tar.gz
go-tangerine-f7cdea2bdcd7ff3cec99731cb912cde0b233d6c9.tar.bz2
go-tangerine-f7cdea2bdcd7ff3cec99731cb912cde0b233d6c9.tar.lz
go-tangerine-f7cdea2bdcd7ff3cec99731cb912cde0b233d6c9.tar.xz
go-tangerine-f7cdea2bdcd7ff3cec99731cb912cde0b233d6c9.tar.zst
go-tangerine-f7cdea2bdcd7ff3cec99731cb912cde0b233d6c9.zip
all: on-chain oracle checkpoint syncing (#19543)
* all: implement simple checkpoint syncing cmd, les, node: remove callback mechanism cmd, node: remove callback definition les: simplify the registrar les: expose checkpoint rpc services in the light client les, light: don't store untrusted receipt cmd, contracts, les: discard stale checkpoint cmd, contracts/registrar: loose restriction of registeration cmd, contracts: add replay-protection all: off-chain multi-signature contract params: deploy checkpoint contract for rinkeby cmd/registrar: add raw signing mode for registrar cmd/registrar, contracts/registrar, les: fixed messages * cmd/registrar, contracts/registrar: fix lints * accounts/abi/bind, les: address comments * cmd, contracts, les, light, params: minor checkpoint sync cleanups * cmd, eth, les, light: move checkpoint config to config file * cmd, eth, les, params: address comments * eth, les, params: address comments * cmd: polish up the checkpoint admin CLI * cmd, contracts, params: deploy new version contract * cmd/checkpoint-admin: add another flag for clef mode signing * cmd, contracts, les: rename and regen checkpoint oracle with abigen
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)
}