core: fix variable shadowing, close XFN-104 (#1649)

This commit is contained in:
Daniel Liu 2025-11-03 15:27:52 +08:00 committed by GitHub
parent 96fbe67bf5
commit 96d39a83e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2209,7 +2209,6 @@ func (bc *BlockChain) getResultBlock(block *types.Block, verifiedM2 bool) (*Resu
// UpdateBlocksHashCache update BlocksHashCache by block number
func (bc *BlockChain) UpdateBlocksHashCache(block *types.Block) []common.Hash {
var hashArr []common.Hash
blockNumber := block.Number().Uint64()
cached, ok := bc.blocksHashCache.Get(blockNumber)
@ -2221,7 +2220,7 @@ func (bc *BlockChain) UpdateBlocksHashCache(block *types.Block) []common.Hash {
return hashArr
}
hashArr = []common.Hash{
hashArr := []common.Hash{
block.Hash(),
}
bc.blocksHashCache.Add(blockNumber, hashArr)