提交 fbba7c8f 作者: Juan Batiz-Benet

bootstrap: only dht bootstrap with live conns

上级 b9fe3780
...@@ -96,10 +96,12 @@ func bootstrap(ctx context.Context, ...@@ -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
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论