skip connection to private IPs (#6093)

Addresses #6079
This commit is contained in:
Giulio rebuffo 2022-11-20 22:41:11 +01:00 committed by GitHub
parent 45938124f5
commit d745b39df9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -84,6 +84,11 @@ func (s *Sentinel) listenForPeers() {
continue
}
// Skip Peer if IP was private.
if node.IP().IsPrivate() {
continue
}
go func(peerInfo *peer.AddrInfo) {
if err := s.connectWithPeer(s.ctx, *peerInfo); err != nil {
log.Debug("Could not connect with peer", "err", err)