From ab34ff4bc92871d3c93493cb97ccba494f74d8eb Mon Sep 17 00:00:00 2001 From: mcrakhman Date: Tue, 4 Jul 2023 08:07:55 +0200 Subject: [PATCH] Fix not sending correct connection and incoming count --- net/peer/peer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/peer/peer.go b/net/peer/peer.go index 25ffbb20..d0226823 100644 --- a/net/peer/peer.go +++ b/net/peer/peer.go @@ -189,7 +189,7 @@ func (p *peer) openDrpcConn(ctx context.Context) (dconn *subConn, err error) { tconn := connutil.NewLastUsageConn(conn) bufSize := p.ctrl.DrpcConfig().Stream.MaxMsgSizeMb * (1 << 20) return &subConn{ - Conn: drpcconn.NewWithOptions(conn, drpcconn.Options{ + Conn: drpcconn.NewWithOptions(tconn, drpcconn.Options{ Manager: drpcmanager.Options{ Reader: drpcwire.ReaderOptions{MaximumBufferSize: bufSize}, Stream: drpcstream.Options{MaximumBufferSize: bufSize}, @@ -296,7 +296,7 @@ func (p *peer) gc(ttl time.Duration) (aliveCount int) { continue } } - return len(p.active) + len(p.inactive) + return len(p.active) + len(p.inactive) + int(p.incomingCount.Load()) } func (p *peer) Close() (err error) {