Skip to content

Commit e3c6776

Browse files
authored
Merge pull request #5769 from zonque/suppress-bootstrap-error
Suppress bootstrap error
2 parents a0e6b0c + 45b34e2 commit e3c6776

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

core/bootstrap.go

+6-5
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ func Bootstrap(n *IpfsNode, cfg BootstrapConfig) (io.Closer, error) {
7777
// make a signal to wait for one bootstrap round to complete.
7878
doneWithRound := make(chan struct{})
7979

80+
if len(cfg.BootstrapPeers()) == 0 {
81+
// We *need* to bootstrap but we have no bootstrap peers
82+
// configured *at all*, inform the user.
83+
log.Error("no bootstrap nodes configured: go-ipfs may have difficulty connecting to the network")
84+
}
85+
8086
// the periodic bootstrap function -- the connection supervisor
8187
periodic := func(worker goprocess.Process) {
8288
ctx := procctx.OnClosingContext(worker)
@@ -138,11 +144,6 @@ func bootstrapRound(ctx context.Context, host host.Host, cfg BootstrapConfig) er
138144
// if connected to all bootstrap peer candidates, exit
139145
if len(notConnected) < 1 {
140146
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-
}
146147
return ErrNotEnoughBootstrapPeers
147148
}
148149

0 commit comments

Comments
 (0)