Further additions to v1.10.13 update.

This commit is contained in:
philip-morlier
2021-11-29 10:21:34 -06:00
committed by Austin Roberts
parent 72b7820579
commit cc416746a1
6 changed files with 36 additions and 48 deletions
+10 -19
View File
@@ -885,27 +885,18 @@ func (api *API) traceTx(ctx context.Context, message core.Message, txctx *Contex
// Constuct the JavaScript tracer to execute with
if t, err := New(*config.Tracer, txctx); err != nil {
return nil, err
} else {
deadlineCtx, cancel := context.WithTimeout(ctx, timeout)
go func() {
<-deadlineCtx.Done()
if errors.Is(deadlineCtx.Err(), context.DeadlineExceeded) {
t.Stop(errors.New("execution timeout"))
}
}()
defer cancel()
tracer = t
}
// Handle timeouts and RPC cancellations
deadlineCtx, cancel := context.WithTimeout(ctx, timeout)
go func() {
<-deadlineCtx.Done()
if errors.Is(deadlineCtx.Err(), context.DeadlineExceeded) {
t.Stop(errors.New("execution timeout"))
}
}()
defer cancel()
tracer = t
}
// Handle timeouts and RPC cancellations
deadlineCtx, cancel := context.WithTimeout(ctx, timeout)
go func() {
<-deadlineCtx.Done()
if deadlineCtx.Err() == context.DeadlineExceeded {
tracer.(*Tracer).Stop(errors.New("execution timeout"))
}
}()
defer cancel()
default:
tracer = vm.NewStructLogger(config.LogConfig)
}