mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 13:16:42 +00:00
eth/catalyst: don't snap sync if network is at genesis
This commit is contained in:
parent
8a171dce1f
commit
de71036ace
1 changed files with 6 additions and 1 deletions
|
|
@ -729,7 +729,12 @@ func (api *ConsensusAPI) newPayload(params engine.ExecutableData, versionedHashe
|
|||
// into the database directly will conflict with the assumptions of snap sync
|
||||
// that it has an empty db that it can fill itself.
|
||||
if api.eth.SyncMode() != ethconfig.FullSync {
|
||||
return api.delayPayloadImport(block), nil
|
||||
// If the client is started at genesis of a test network with snap sync
|
||||
// enabled, just try to import the block since there is nothing to sync.
|
||||
if block.NumberU64() != 1 {
|
||||
return api.delayPayloadImport(block), nil
|
||||
}
|
||||
api.eth.SetSynced()
|
||||
}
|
||||
if !api.eth.BlockChain().HasBlockAndState(block.ParentHash(), block.NumberU64()-1) {
|
||||
api.remoteBlocks.put(block.Hash(), block.Header())
|
||||
|
|
|
|||
Loading…
Reference in a new issue