Skip to content

Commit c7a9b73

Browse files
committed
fix: use the routing table filter
fixes #575
1 parent 6c82b40 commit c7a9b73

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

subscriber_notifee.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,11 @@ func handleLocalReachabilityChangedEvent(dht *IpfsDHT, e event.EvtLocalReachabil
172172
// routing table
173173
func (dht *IpfsDHT) validRTPeer(p peer.ID) (bool, error) {
174174
protos, err := dht.peerstore.SupportsProtocols(p, protocol.ConvertToStrings(dht.protocols)...)
175-
if err != nil {
175+
if len(protos) == 0 || err != nil {
176176
return false, err
177177
}
178178

179-
return len(protos) > 0, nil
179+
return dht.routingTablePeerFilter == nil || dht.routingTablePeerFilter(dht, dht.Host().Network().ConnsToPeer(p)), nil
180180
}
181181

182182
func (nn *subscriberNotifee) Disconnected(n network.Network, v network.Conn) {

0 commit comments

Comments
 (0)