From 35bb751bac924410ea0f2ad0df0b2900d17ef4f8 Mon Sep 17 00:00:00 2001 From: Pierre <974741468@qq.com> Date: Sat, 16 Jan 2021 00:01:03 +0800 Subject: [PATCH] x/evm: Modify the Copy function in CommitStateDB (#720) --- x/evm/types/statedb.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/x/evm/types/statedb.go b/x/evm/types/statedb.go index 24ccdc46..758db7df 100644 --- a/x/evm/types/statedb.go +++ b/x/evm/types/statedb.go @@ -784,6 +784,14 @@ func CopyCommitStateDB(from, to *CommitStateDB) { to.preimages = make([]preimageEntry, len(from.preimages)) to.hashToPreimageIndex = make(map[ethcmn.Hash]int, len(from.hashToPreimageIndex)) to.journal = newJournal() + to.thash = from.thash + to.bhash = from.bhash + to.txIndex = from.txIndex + validRevisions := make([]revision, len(from.validRevisions)) + copy(validRevisions, from.validRevisions) + to.validRevisions = validRevisions + to.nextRevisionID = from.nextRevisionID + to.accessList = from.accessList.Copy() // copy the dirty states, logs, and preimages for _, dirty := range from.journal.dirties {