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
1 changed files with 3 additions and 0 deletions

View File

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