rm : remove interruptctx from txsCh select case (#846)

* rm : remove interruptctx from txsCh select case

* lint : fix lint
This commit is contained in:
SHIVAM SHARMA 2023-05-04 15:33:11 +05:30 committed by GitHub
parent 5fba09885d
commit 6e0d723227
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -675,29 +675,13 @@ func (w *worker) mainLoop(ctx context.Context) {
tcount := w.current.tcount tcount := w.current.tcount
//nolint:contextcheck //nolint:contextcheck
var interruptCtx = context.Background() w.commitTransactions(w.current, txset, nil, context.Background())
stopFn := func() {}
defer func() {
stopFn()
}()
if w.interruptCommitFlag {
interruptCtx, stopFn = getInterruptTimer(ctx, w.current, w.chain.CurrentBlock())
// nolint : staticcheck
interruptCtx = vm.PutCache(interruptCtx, w.interruptedTxCache)
}
w.commitTransactions(w.current, txset, nil, interruptCtx)
// Only update the snapshot if any new transactions were added // Only update the snapshot if any new transactions were added
// to the pending block // to the pending block
if tcount != w.current.tcount { if tcount != w.current.tcount {
w.updateSnapshot(w.current) w.updateSnapshot(w.current)
} }
stopFn()
} else { } else {
// Special case, if the consensus engine is 0 period clique(dev mode), // Special case, if the consensus engine is 0 period clique(dev mode),
// submit sealing work here since all empty submission will be rejected // submit sealing work here since all empty submission will be rejected