mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-03-03 10:03:47 +00:00
trie/bintrie: fix endianness in code chunk key computation (#33900)
The endianness was wrong, which means that the code chunks were stored in the wrong location in the tree.
This commit is contained in:
parent
7793e00f0d
commit
95c6b05806
1 changed files with 1 additions and 1 deletions
|
|
@ -384,7 +384,7 @@ func (t *BinaryTrie) UpdateContractCode(addr common.Address, codeHash common.Has
|
|||
if groupOffset == 0 /* start of new group */ || chunknr == 0 /* first chunk in header group */ {
|
||||
values = make([][]byte, StemNodeWidth)
|
||||
var offset [HashSize]byte
|
||||
binary.LittleEndian.PutUint64(offset[24:], chunknr+128)
|
||||
binary.BigEndian.PutUint64(offset[24:], chunknr+128)
|
||||
key = GetBinaryTreeKey(addr, offset[:])
|
||||
}
|
||||
values[groupOffset] = chunks[i : i+HashSize]
|
||||
|
|
|
|||
Loading…
Reference in a new issue