forked from cerc-io/plugeth
Merge pull request #22686 from holiman/minor_fixes
core/state/snapshot: avoid copybytes for stacktrie
This commit is contained in:
commit
e43ac53264
@ -317,7 +317,7 @@ func (dl *diskLayer) proveRange(stats *generatorStats, root common.Hash, prefix
|
|||||||
if origin == nil && !diskMore {
|
if origin == nil && !diskMore {
|
||||||
stackTr := trie.NewStackTrie(nil)
|
stackTr := trie.NewStackTrie(nil)
|
||||||
for i, key := range keys {
|
for i, key := range keys {
|
||||||
stackTr.TryUpdate(key, common.CopyBytes(vals[i]))
|
stackTr.TryUpdate(key, vals[i])
|
||||||
}
|
}
|
||||||
if gotRoot := stackTr.Hash(); gotRoot != root {
|
if gotRoot := stackTr.Hash(); gotRoot != root {
|
||||||
return &proofResult{
|
return &proofResult{
|
||||||
|
@ -830,8 +830,8 @@ func TestCommitSequenceStackTrie(t *testing.T) {
|
|||||||
val = make([]byte, 1+prng.Intn(1024))
|
val = make([]byte, 1+prng.Intn(1024))
|
||||||
}
|
}
|
||||||
prng.Read(val)
|
prng.Read(val)
|
||||||
trie.TryUpdate(key, common.CopyBytes(val))
|
trie.TryUpdate(key, val)
|
||||||
stTrie.TryUpdate(key, common.CopyBytes(val))
|
stTrie.TryUpdate(key, val)
|
||||||
}
|
}
|
||||||
// Flush trie -> database
|
// Flush trie -> database
|
||||||
root, _ := trie.Commit(nil)
|
root, _ := trie.Commit(nil)
|
||||||
|
Loading…
Reference in New Issue
Block a user