pex: do not send nil envelopes to the reactor (#7622)

This commit is contained in:
M. J. Fromberger
2022-01-18 12:01:04 -08:00
committed by GitHub
parent 7fd97bf44b
commit 417166704a
+5 -1
View File
@@ -171,10 +171,14 @@ func (r *Reactor) processPexCh(ctx context.Context) {
defer close(incoming)
iter := r.pexCh.Receive(ctx)
for iter.Next(ctx) {
env := iter.Envelope()
if env == nil {
break
}
select {
case <-ctx.Done():
return
case incoming <- iter.Envelope():
case incoming <- env:
}
}
}()