Skip to content

Commit

Permalink
trie: always copy keys
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Nov 26, 2021
1 parent 782c86d commit 50c1df8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions trie/stacktrie.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,15 @@ func (st *StackTrie) setDb(db ethdb.KeyValueWriter) {
func newLeaf(key, val []byte, db ethdb.KeyValueWriter) *StackTrie {
st := stackTrieFromPool(db)
st.nodeType = leafNode
st.key = key
st.key = append(st.key, key...)
st.val = val
return st
}

func newExt(key []byte, child *StackTrie, db ethdb.KeyValueWriter) *StackTrie {
st := stackTrieFromPool(db)
st.nodeType = extNode
st.key = key
st.key = append(st.key, key...)
st.children[0] = child
return st
}
Expand Down

0 comments on commit 50c1df8

Please sign in to comment.