mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
fix: alignment of values whose len is < 32
This commit is contained in:
parent
375219076c
commit
5cece9e124
1 changed files with 5 additions and 1 deletions
|
|
@ -205,7 +205,11 @@ func (trie *VerkleTrie) UpdateStem(key []byte, values [][]byte) error {
|
|||
func (trie *VerkleTrie) UpdateStorage(address common.Address, key, value []byte) error {
|
||||
k := utils.GetTreeKeyStorageSlotWithEvaluatedAddress(trie.pointCache.GetTreeKeyHeader(address[:]), key)
|
||||
var v [32]byte
|
||||
copy(v[:], value[:])
|
||||
if len(value) >= 32 {
|
||||
copy(v[:], value[:32])
|
||||
} else {
|
||||
copy(v[32-len(value):], value[:])
|
||||
}
|
||||
return trie.root.Insert(k, v[:], trie.flatdbNodeResolver)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue