From cd49f75cb9ca83065609d02d9813acf31e24b4af Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Sat, 18 Sep 2021 21:01:06 +1000 Subject: [PATCH] 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. --- peerconn.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/peerconn.go b/peerconn.go index 4eca560e..452166ac 100644 --- a/peerconn.go +++ b/peerconn.go @@ -653,6 +653,9 @@ func (cn *PeerConn) postBitfield() { } func (cn *PeerConn) updateRequests() { + if len(cn.actualRequestState.Requests) != 0 { + return + } cn.tickleWriter() }