diff --git a/core/coreapi/swarm.go b/core/coreapi/swarm.go index 9f9dc55aabd..8b55e8278e3 100644 --- a/core/coreapi/swarm.go +++ b/core/coreapi/swarm.go @@ -40,7 +40,7 @@ func (api *SwarmAPI) Connect(ctx context.Context, pi pstore.PeerInfo) error { swrm.Backoff().Clear(pi.ID) } - if err := api.peerHost.Connect(ctx, pi); err == nil { + if err := api.peerHost.Connect(ctx, pi); err != nil { return err }