From: Matt Joiner Date: Mon, 20 Sep 2021 04:16:55 +0000 (+1000) Subject: Filter next requests application for peer state changes X-Git-Tag: v1.32.0~29^2~1 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=33883c04e4272a2c1e43d5a55ba7fe3eefdeb2bd;p=btrtrc.git Filter next requests application for peer state changes --- diff --git a/requesting.go b/requesting.go index 7e42baba..3d29d481 100644 --- a/requesting.go +++ b/requesting.go @@ -132,6 +132,11 @@ func (p *Peer) applyNextRequestState() bool { } } for req := range next.Requests { + // This could happen if the peer chokes us between the next state being generated, and us + // trying to transmit the state. + if p.peerChoking && !p.peerAllowedFast.Contains(bitmap.BitIndex(req.Index)) { + continue + } more, err := p.request(req) if err != nil { panic(err)