evm: conditional hook snapshot (#520)
This commit is contained in:
parent
770ce367ac
commit
5fac39db38
@ -175,8 +175,11 @@ func (k *Keeper) ApplyTransaction(tx *ethtypes.Transaction) (*types.MsgEthereumT
|
|||||||
panic("context stack shouldn't be dirty before apply message")
|
panic("context stack shouldn't be dirty before apply message")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Contains the tx processing and post processing in same scope
|
var revision int
|
||||||
revision := k.Snapshot()
|
if k.hooks != nil {
|
||||||
|
// snapshot to contain the tx processing and post processing in same scope
|
||||||
|
revision = k.Snapshot()
|
||||||
|
}
|
||||||
|
|
||||||
// pass false to execute in real mode, which do actual gas refunding
|
// pass false to execute in real mode, which do actual gas refunding
|
||||||
res, err := k.ApplyMessage(evm, msg, ethCfg, false)
|
res, err := k.ApplyMessage(evm, msg, ethCfg, false)
|
||||||
|
Loading…
Reference in New Issue
Block a user