@@ -20,6 +20,7 @@ import (
20
20
"maps"
21
21
22
22
"github.com/ethereum/go-ethereum/common"
23
+ "github.com/ethereum/go-ethereum/core/types"
23
24
"github.com/holiman/uint256"
24
25
)
25
26
@@ -159,12 +160,8 @@ func (j *journal) JournalBalanceChange(addr common.Address, previous *uint256.In
159
160
})
160
161
}
161
162
162
- func (j * journal ) JournalSetCode (address common.Address , prevcode , prevHash []byte ) {
163
- j .append (codeChange {
164
- account : & address ,
165
- prevhash : prevHash ,
166
- prevcode : prevcode ,
167
- })
163
+ func (j * journal ) JournalSetCode (address common.Address ) {
164
+ j .append (codeChange {account : & address })
168
165
}
169
166
170
167
func (j * journal ) JournalNonceChange (address common.Address , prev uint64 ) {
@@ -220,8 +217,7 @@ type (
220
217
origvalue common.Hash
221
218
}
222
219
codeChange struct {
223
- account * common.Address
224
- prevcode , prevhash []byte
220
+ account * common.Address
225
221
}
226
222
227
223
// Changes to other state values.
@@ -348,19 +344,15 @@ func (ch nonceChange) copy() journalEntry {
348
344
}
349
345
350
346
func (ch codeChange ) revert (s * StateDB ) {
351
- s .getStateObject (* ch .account ).setCode (common . BytesToHash ( ch . prevhash ), ch . prevcode )
347
+ s .getStateObject (* ch .account ).setCode (types . EmptyCodeHash , nil )
352
348
}
353
349
354
350
func (ch codeChange ) dirtied () * common.Address {
355
351
return ch .account
356
352
}
357
353
358
354
func (ch codeChange ) copy () journalEntry {
359
- return codeChange {
360
- account : ch .account ,
361
- prevhash : common .CopyBytes (ch .prevhash ),
362
- prevcode : common .CopyBytes (ch .prevcode ),
363
- }
355
+ return codeChange {account : ch .account }
364
356
}
365
357
366
358
func (ch storageChange ) revert (s * StateDB ) {
0 commit comments