1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-29 01:12:24 +08:00

bootstrap: only dht bootstrap with live conns

This commit is contained in:
Juan Batiz-Benet
2015-01-06 10:10:20 -08:00
parent b9fe37801f
commit fbba7c8f39

View File

@ -96,10 +96,12 @@ func bootstrap(ctx context.Context,
} }
// we can try running dht bootstrap even if we're connected to all bootstrap peers. // we can try running dht bootstrap even if we're connected to all bootstrap peers.
if err := r.Bootstrap(ctx, numDHTBootstrapQueries); err != nil { if len(h.Network().Conns()) > 0 {
// log this as Info. later on, discern better between errors. if err := r.Bootstrap(ctx, numDHTBootstrapQueries); err != nil {
log.Infof("dht bootstrap err: %s", err) // log this as Info. later on, discern better between errors.
return nil log.Infof("dht bootstrap err: %s", err)
return nil
}
} }
return nil return nil
} }