Merge branch 'master' into dev-upgrade-fix-merge

This commit is contained in:
Wanwiset Peerapatanapokin 2024-09-11 14:06:38 +04:00 committed by GitHub
commit 0e9052b2e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -664,8 +664,10 @@ func (bc *BlockChain) ExportN(w io.Writer, first uint64, last uint64) error {
//
// Note, this function assumes that the `mu` mutex is held!
func (bc *BlockChain) insert(block *types.Block, writeBlock bool) {
blockHash := block.Hash()
blockNumberU64 := block.NumberU64()
// If the block is on a side chain or an unknown one, force other heads onto it too
updateHeads := GetCanonicalHash(bc.db, blockNumberU64) != blockHash