mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-19 22:40:31 +00:00
Co-authored-by: Gary Rong <garyrong0905@gmail.com> Co-authored-by: Mikhail Kalinin <noblesse.knight@gmail.com>
This commit is contained in:
parent
216ed05c6e
commit
3094e7f3b8
1 changed files with 2 additions and 0 deletions
|
|
@ -79,8 +79,10 @@ type blockExecutionEnv struct {
|
||||||
|
|
||||||
func (env *blockExecutionEnv) commitTransaction(tx *types.Transaction, coinbase common.Address) error {
|
func (env *blockExecutionEnv) commitTransaction(tx *types.Transaction, coinbase common.Address) error {
|
||||||
vmconfig := *env.chain.GetVMConfig()
|
vmconfig := *env.chain.GetVMConfig()
|
||||||
|
snap := env.state.Snapshot()
|
||||||
receipt, err := core.ApplyTransaction(env.chain.Config(), env.chain, &coinbase, env.gasPool, env.state, env.header, tx, &env.header.GasUsed, vmconfig)
|
receipt, err := core.ApplyTransaction(env.chain.Config(), env.chain, &coinbase, env.gasPool, env.state, env.header, tx, &env.header.GasUsed, vmconfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
env.state.RevertToSnapshot(snap)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
env.txs = append(env.txs, tx)
|
env.txs = append(env.txs, tx)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue