File tree Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Original file line number Diff line number Diff line change @@ -12,12 +12,8 @@ import (
12
12
"github.com/libp2p/go-libp2p/p2p/net/conngater"
13
13
)
14
14
15
- const (
16
- // defaultScore specifies the score for newly connected peers.
17
- defaultScore float32 = 1
18
- // maxPeerTrackerSize specifies the max amount of peers that can be added to the peerTracker.
19
- maxPeerTrackerSize = 100
20
- )
15
+ // defaultScore specifies the score for newly connected peers.
16
+ const defaultScore float32 = 1
21
17
22
18
var (
23
19
// maxAwaitingTime specifies the duration that gives to the disconnected peer to be back online,
@@ -182,13 +178,6 @@ func (p *peerTracker) connected(pID libpeer.ID) {
182
178
183
179
p .peerLk .Lock ()
184
180
defer p .peerLk .Unlock ()
185
- // skip adding the peer to avoid overfilling of the peerTracker with unused peers if:
186
- // peerTracker reaches the maxTrackerSize and there are more connected peers
187
- // than disconnected peers.
188
- if len (p .trackedPeers )+ len (p .disconnectedPeers ) > maxPeerTrackerSize &&
189
- len (p .trackedPeers ) > len (p .disconnectedPeers ) {
190
- return
191
- }
192
181
193
182
// additional check in p.trackedPeers should be done,
194
183
// because libp2p does not emit multiple Connected events per 1 peer
You can’t perform that action at this time.
0 commit comments