aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/state/statedb.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/core/state/statedb.go b/core/state/statedb.go
index 92d394ae3..101b03a12 100644
--- a/core/state/statedb.go
+++ b/core/state/statedb.go
@@ -489,10 +489,13 @@ func (self *StateDB) Copy() *StateDB {
state.stateObjectsDirty[addr] = struct{}{}
}
}
-
for hash, logs := range self.logs {
- state.logs[hash] = make([]*types.Log, len(logs))
- copy(state.logs[hash], logs)
+ cpy := make([]*types.Log, len(logs))
+ for i, l := range logs {
+ cpy[i] = new(types.Log)
+ *cpy[i] = *l
+ }
+ state.logs[hash] = cpy
}
for hash, preimage := range self.preimages {
state.preimages[hash] = preimage