From f48053cf763c63931fe2d0cf9b7bb70b8ceb95b9 Mon Sep 17 00:00:00 2001 From: Alan Orwick Date: Thu, 21 Jul 2022 09:56:39 -0500 Subject: [PATCH] blockchain.go: added guard for CheckCanonical --- core/blockchain.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/core/blockchain.go b/core/blockchain.go index fd09be93da..2bf65f3dad 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -2214,16 +2214,18 @@ func (bc *BlockChain) insertChain(chain types.Blocks, verifySeals bool, setHead } } - err = bc.CheckCanonical(block.Header(), order) - if err != nil { - if err.Error() == "dominant chain not synced" { - fmt.Println("dom not synced, adding to future blocks", block.Header().Hash()) - if err := bc.addFutureBlock(block); err != nil { + if order < types.QuaiNetworkContext { + err = bc.CheckCanonical(block.Header(), order) + if err != nil { + if err.Error() == "dominant chain not synced" { + fmt.Println("dom not synced, adding to future blocks", block.Header().Hash()) + if err := bc.addFutureBlock(block); err != nil { + return it.index, err + } + return it.index, nil + } else { return it.index, err } - return it.index, nil - } else { - return it.index, err } }