@cryptotaxi247 / kubo / commits / 224bc0d97

make warnings on no bootstrap peers less noisy

We only need to warn the user if we *can't* connect to the network. License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>

Steven Allen committed Sep 13, 2018 at 22:46 UTC 224bc0d97f1a9a31a67e2366b274808ebcca33d7
1 file changed +5 -3
core/bootstrap.go
+5 -3
@@ -117,9 +117,6 @@ 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 - if len(peers) == 0 {
121 - log.Error("no bootstrap nodes configured: go-ipfs may have difficulty connecting to the network")
122 - }
120 // determine how many bootstrap connections to open
121 connected := host.Network().Peers()
122 if len(connected) >= cfg.MinPeerThreshold {
@@ -141,6 +138,11 @@ func bootstrapRound(ctx context.Context, host host.Host, cfg BootstrapConfig) er
138 // if connected to all bootstrap peer candidates, exit
139 if len(notConnected) < 1 {
140 log.Debugf("%s no more bootstrap peers to create %d connections", id, numToDial)
141 + if len(peers) == 0 {
142 + // We *need* to bootstrap but we have no bootstrap peers
143 + // configured *at all*, inform the user.
144 + log.Error("no bootstrap nodes configured: go-ipfs may have difficulty connecting to the network")
145 + }
146 return ErrNotEnoughBootstrapPeers
147 }
148