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