core/state: copy trie too, not just content

This commit is contained in:
Péter Szilágyi
2017-11-24 11:02:25 +02:00
parent 9ff9d04a69
commit 5dea0f2aa4
2 changed files with 52 additions and 1 deletions

View File

@ -453,7 +453,7 @@ func (self *StateDB) Copy() *StateDB {
// Copy all the basic fields, initialize the memory ones
state := &StateDB{
db: self.db,
trie: self.trie,
trie: self.db.CopyTrie(self.trie),
stateObjects: make(map[common.Address]*stateObject, len(self.stateObjectsDirty)),
stateObjectsDirty: make(map[common.Address]struct{}, len(self.stateObjectsDirty)),
refund: new(big.Int).Set(self.refund),