trie: fix leftover

This commit is contained in:
Piotr Mikołajczyk 2025-11-18 12:07:18 +01:00
parent fd7ed1c977
commit dbc5c05fdb
No known key found for this signature in database
GPG key ID: 2E4C2AAD5E71D22D

View file

@ -23,6 +23,7 @@ import (
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
) )
var ( var (
@ -414,8 +415,7 @@ func (t *StackTrie) hash(st *stNode, path []byte) {
} }
// Write the hash to the 'val'. We allocate a new val here to not mutate // Write the hash to the 'val'. We allocate a new val here to not mutate
// input values. // input values.
st.val = bPool.getWithSize(32) st.val = crypto.Keccak256(blob)
t.h.hashDataTo(st.val, blob)
// Invoke the callback it's provided. Notably, the path and blob slices are // Invoke the callback it's provided. Notably, the path and blob slices are
// volatile, please deep-copy the slices in callback if the contents need // volatile, please deep-copy the slices in callback if the contents need