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

Modify the copy function in CommitStateDB #720

Merged
merged 1 commit into from
Jan 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions x/evm/types/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down