mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-19 03:10:48 +00:00
Refactor context cancellation for EVM execution
This commit is contained in:
parent
777265620d
commit
51f73873f8
1 changed files with 1 additions and 4 deletions
|
|
@ -741,10 +741,7 @@ func applyMessage(ctx context.Context, b Backend, args TransactionArgs, state *s
|
|||
func applyMessageWithEVM(ctx context.Context, evm *vm.EVM, msg *core.Message, timeout time.Duration, gp *core.GasPool) (*core.ExecutionResult, error) {
|
||||
// Wait for the context to be done and cancel the evm. Even if the
|
||||
// EVM has finished, cancelling may be done (repeatedly)
|
||||
go func() {
|
||||
<-ctx.Done()
|
||||
evm.Cancel()
|
||||
}()
|
||||
context.AfterFunc(ctx, evm.Cancel)
|
||||
|
||||
// Execute the message.
|
||||
result, err := core.ApplyMessage(evm, msg, gp)
|
||||
|
|
|
|||
Loading…
Reference in a new issue