@@ -18,6 +18,7 @@ package state
1818
1919import (
2020 "github.com/ethereum/go-ethereum/common"
21+ "github.com/ethereum/go-ethereum/core/types"
2122 "github.com/holiman/uint256"
2223)
2324
@@ -145,12 +146,10 @@ func (j *journal) JournalBalanceChange(addr common.Address, previous *uint256.In
145146 })
146147}
147148
148- func (j * journal ) JournalSetCode (address common.Address , prevcode , prevHash []byte ) {
149- j .append (codeChange {
150- account : & address ,
151- prevhash : prevHash ,
152- prevcode : prevcode ,
153- })
149+ // JournalSetCode journals the setting of code: it is implicit that the previous
150+ // values were "no code" and emptyCodeHash.
151+ func (j * journal ) JournalSetCode (address common.Address ) {
152+ j .append (codeChange {account : & address })
154153}
155154
156155func (j * journal ) JournalNonceChange (address common.Address , prev uint64 ) {
@@ -228,8 +227,7 @@ type (
228227 key , prevalue common.Hash
229228 }
230229 codeChange struct {
231- account * common.Address
232- prevcode , prevhash []byte
230+ account * common.Address
233231 }
234232
235233 // Changes to other state values.
@@ -330,7 +328,7 @@ func (ch nonceChange) dirtied() *common.Address {
330328}
331329
332330func (ch codeChange ) revert (s * StateDB ) {
333- s .getStateObject (* ch .account ).setCode (common . BytesToHash ( ch . prevhash ), ch . prevcode )
331+ s .getStateObject (* ch .account ).setCode (types . EmptyCodeHash , nil )
334332}
335333
336334func (ch codeChange ) dirtied () * common.Address {
0 commit comments