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

@ -674,30 +674,14 @@ func (w *worker) mainLoop(ctx context.Context) {
txset := types.NewTransactionsByPriceAndNonce(w.current.signer, txs, cmath.FromBig(w.current.header.BaseFee))
tcount := w.current.tcount
// nolint : contextcheck
var interruptCtx = 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)
//nolint:contextcheck
w.commitTransactions(w.current, txset, nil, context.Background())
// Only update the snapshot if any new transactions were added
// to the pending block
if tcount != w.current.tcount {
w.updateSnapshot(w.current)
}
stopFn()
} else {
// Special case, if the consensus engine is 0 period clique(dev mode),
// submit sealing work here since all empty submission will be rejected