add warning when no bootstrap in config
License: MIT Signed-off-by: Kejie Zhang <601172892@qq.com>
Kejie Zhang committed
Sep 10, 2018 at 20:20 UTC
c2bb1ad796d00fe1a0ca918101a9737bf4f1c0a6
1 file changed
+3
-1
core/bootstrap.go
+3
-1
@@ -117,7 +117,9 @@ func bootstrapRound(ctx context.Context, host host.Host, cfg BootstrapConfig) er
117
// get bootstrap peers from config. retrieving them here makes
118
// sure we remain observant of changes to client configuration.
119
peers := cfg.BootstrapPeers()
120
-
120
+ if len(peers) == 0 {
121
+ log.Warning("no bootstrap in the configuration file")
122
+ }
123
// determine how many bootstrap connections to open
124
connected := host.Network().Peers()
125
if len(connected) >= cfg.MinPeerThreshold {