2
0
mirror of synced 2025-02-23 14:18:13 +00:00

When updating requests, only tickle writer if there are no requests pending

Just a quick attempt to reduce load for now. There'll be a much better way to do this.
This commit is contained in:
Matt Joiner 2021-09-18 21:01:06 +10:00
parent 21358ba458
commit cd49f75cb9

View File

@ -653,6 +653,9 @@ func (cn *PeerConn) postBitfield() {
}
func (cn *PeerConn) updateRequests() {
if len(cn.actualRequestState.Requests) != 0 {
return
}
cn.tickleWriter()
}