mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 01:13:45 +00:00
trie: copy secKeyCache when copying secure trie
This commit is contained in:
parent
60bf0329a9
commit
cb63bbef86
1 changed files with 7 additions and 0 deletions
|
|
@ -158,6 +158,13 @@ func (t *SecureTrie) Root() []byte {
|
||||||
|
|
||||||
func (t *SecureTrie) Copy() *SecureTrie {
|
func (t *SecureTrie) Copy() *SecureTrie {
|
||||||
cpy := *t
|
cpy := *t
|
||||||
|
if len(t.secKeyCache) > 0 {
|
||||||
|
cpy.secKeyCache = make(map[string][]byte)
|
||||||
|
for k, v := range t.secKeyCache {
|
||||||
|
cpy.secKeyCache[k] = v
|
||||||
|
}
|
||||||
|
cpy.secKeyCacheOwner = &cpy
|
||||||
|
}
|
||||||
return &cpy
|
return &cpy
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue