fix: ErrTransportNotSupported check in wrong location

This commit is contained in:
Derrick Hammer 2024-03-05 15:06:42 -05:00
parent cca7d881de
commit a87bfe7ba6
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 6 additions and 5 deletions

View File

@ -285,6 +285,12 @@ func (p *P2PServiceDefault) ConnectToNode(connectionUris []*url.URL, retried boo
return nil return nil
} }
if errors.Is(err, net.ErrTransportNotSupported) {
p.Logger().Debug("failed to connect, unsupported transport", zap.String("node", connectionUri.String()), zap.Error(err))
return err
}
retried = true retried = true
p.Logger().Error("failed to connect", zap.String("node", connectionUri.String()), zap.Error(err)) p.Logger().Error("failed to connect", zap.String("node", connectionUri.String()), zap.Error(err))
@ -302,11 +308,6 @@ func (p *P2PServiceDefault) ConnectToNode(connectionUris []*url.URL, retried boo
return p.ConnectToNode(connectionUris, retried, fromPeer) return p.ConnectToNode(connectionUris, retried, fromPeer)
} }
if errors.Is(err, net.ErrTransportNotSupported) {
p.Logger().Debug("failed to connect, unsupported transport", zap.String("node", connectionUri.String()), zap.Error(err))
return err
}
if p.outgoingPeerFailures.Contains(idString) { if p.outgoingPeerFailures.Contains(idString) {
p.outgoingPeerFailures.Remove(idString) p.outgoingPeerFailures.Remove(idString)
} }