mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-20 19:19:06 +08:00
Merge pull request #5466 from ipfs/fix/less-noisy-boostrap-warning
make warnings on no bootstrap peers less noisy
This commit is contained in:
@ -117,9 +117,6 @@ func bootstrapRound(ctx context.Context, host host.Host, cfg BootstrapConfig) er
|
|||||||
// get bootstrap peers from config. retrieving them here makes
|
// get bootstrap peers from config. retrieving them here makes
|
||||||
// sure we remain observant of changes to client configuration.
|
// sure we remain observant of changes to client configuration.
|
||||||
peers := cfg.BootstrapPeers()
|
peers := cfg.BootstrapPeers()
|
||||||
if len(peers) == 0 {
|
|
||||||
log.Error("no bootstrap nodes configured: go-ipfs may have difficulty connecting to the network")
|
|
||||||
}
|
|
||||||
// determine how many bootstrap connections to open
|
// determine how many bootstrap connections to open
|
||||||
connected := host.Network().Peers()
|
connected := host.Network().Peers()
|
||||||
if len(connected) >= cfg.MinPeerThreshold {
|
if len(connected) >= cfg.MinPeerThreshold {
|
||||||
@ -141,6 +138,11 @@ func bootstrapRound(ctx context.Context, host host.Host, cfg BootstrapConfig) er
|
|||||||
// if connected to all bootstrap peer candidates, exit
|
// if connected to all bootstrap peer candidates, exit
|
||||||
if len(notConnected) < 1 {
|
if len(notConnected) < 1 {
|
||||||
log.Debugf("%s no more bootstrap peers to create %d connections", id, numToDial)
|
log.Debugf("%s no more bootstrap peers to create %d connections", id, numToDial)
|
||||||
|
if len(peers) == 0 {
|
||||||
|
// We *need* to bootstrap but we have no bootstrap peers
|
||||||
|
// configured *at all*, inform the user.
|
||||||
|
log.Error("no bootstrap nodes configured: go-ipfs may have difficulty connecting to the network")
|
||||||
|
}
|
||||||
return ErrNotEnoughBootstrapPeers
|
return ErrNotEnoughBootstrapPeers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user