Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dean65 committed Jul 1, 2022
1 parent 363bb96 commit 149718f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,10 @@ func (bc *BlockChain) cacheReceipts(hash common.Hash, receipts types.Receipts) {
}

func (bc *BlockChain) cacheDiffLayer(diffLayer *types.DiffLayer, diffLayerCh chan struct{}) {
// The difflayer in the system is stored by the map structure,
// so it will be out of order.
// It must be sorted first and then cached,
// otherwise the DiffHash calculated by different nodes will be inconsistent
sort.SliceStable(diffLayer.Codes, func(i, j int) bool {
return diffLayer.Codes[i].Hash.Hex() < diffLayer.Codes[j].Hash.Hex()
})
Expand Down Expand Up @@ -2163,9 +2167,6 @@ func (bc *BlockChain) insertChain(chain types.Blocks, verifySeals bool) (int, er
if err != nil {
return it.index, err
}
if statedb.NoTrie() {
statedb.SetExpectedStateRoot(block.Root())
}
bc.updateHighestVerifiedHeader(block.Header())

// Enable prefetching to pull in trie node paths while processing transactions
Expand Down

0 comments on commit 149718f

Please sign in to comment.