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,
@@ -177,13 +173,6 @@ func (p *peerTracker) connected(pID libpeer.ID) {
177
173
178
174
p .peerLk .Lock ()
179
175
defer p .peerLk .Unlock ()
180
- // skip adding the peer to avoid overfilling of the peerTracker with unused peers if:
181
- // peerTracker reaches the maxTrackerSize and there are more connected peers
182
- // than disconnected peers.
183
- if len (p .trackedPeers )+ len (p .disconnectedPeers ) > maxPeerTrackerSize &&
184
- len (p .trackedPeers ) > len (p .disconnectedPeers ) {
185
- return
186
- }
187
176
188
177
// additional check in p.trackedPeers should be done,
189
178
// because libp2p does not emit multiple Connected events per 1 peer
You can’t perform that action at this time.
0 commit comments