Skip to content
This repository was archived by the owner on Nov 30, 2021. It is now read-only.

Commit 35bb751

Browse files
authored
x/evm: Modify the Copy function in CommitStateDB (#720)
1 parent 1d22f49 commit 35bb751

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

x/evm/types/statedb.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,14 @@ func CopyCommitStateDB(from, to *CommitStateDB) {
784784
to.preimages = make([]preimageEntry, len(from.preimages))
785785
to.hashToPreimageIndex = make(map[ethcmn.Hash]int, len(from.hashToPreimageIndex))
786786
to.journal = newJournal()
787+
to.thash = from.thash
788+
to.bhash = from.bhash
789+
to.txIndex = from.txIndex
790+
validRevisions := make([]revision, len(from.validRevisions))
791+
copy(validRevisions, from.validRevisions)
792+
to.validRevisions = validRevisions
793+
to.nextRevisionID = from.nextRevisionID
794+
to.accessList = from.accessList.Copy()
787795

788796
// copy the dirty states, logs, and preimages
789797
for _, dirty := range from.journal.dirties {

0 commit comments

Comments
 (0)