Skip to content

Commit

Permalink
refactor: warning when bootstrap disabled by user
Browse files Browse the repository at this point in the history
#8166 (comment)
(cherry picked from commit 904cc73)
  • Loading branch information
lidel authored and aschmahmann committed Jun 22, 2021
1 parent 4c14b61 commit a70be54
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmd/ipfs/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,16 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment
// Give the user heads up if daemon running in online mode has no peers after 1 minute
if !offline {
time.AfterFunc(1*time.Minute, func() {
cfg, err := cctx.GetConfig()
if err != nil {
log.Errorf("failed to access config: %s", err)
}
if len(cfg.Bootstrap) == 0 && len(cfg.Peering.Peers) == 0 {
// Skip peer check if Bootstrap and Peering lists are empty
// (means user disabled them on purpose)
log.Warn("skipping bootstrap: empty Bootstrap and Peering lists")
return
}
ipfs, err := coreapi.NewCoreAPI(node)
if err != nil {
log.Errorf("failed to access CoreAPI: %v", err)
Expand Down

0 comments on commit a70be54

Please sign in to comment.