mempool: do not continue checking transactions if context was cacneled (#8549)

This commit is contained in:
Sam Kleinman
2022-05-14 08:27:53 -04:00
committed by GitHub
parent bdca727014
commit 42e5924662

View File

@@ -153,6 +153,15 @@ func (r *Reactor) handleMempoolMessage(ctx context.Context, envelope *p2p.Envelo
// problem.
continue
}
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
// Do not propagate context
// cancellation errors, but do
// not continue to check
// transactions from this
// message if we are shutting down.
return nil
}
logger.Error("checktx failed for tx",
"tx", fmt.Sprintf("%X", types.Tx(tx).Hash()),
"err", err)