Skip to content

Commit a70be54

Browse files
lidelaschmahmann
authored andcommitted
refactor: warning when bootstrap disabled by user
#8166 (comment) (cherry picked from commit 904cc73)
1 parent 4c14b61 commit a70be54

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

cmd/ipfs/daemon.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,16 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment
515515
// Give the user heads up if daemon running in online mode has no peers after 1 minute
516516
if !offline {
517517
time.AfterFunc(1*time.Minute, func() {
518+
cfg, err := cctx.GetConfig()
519+
if err != nil {
520+
log.Errorf("failed to access config: %s", err)
521+
}
522+
if len(cfg.Bootstrap) == 0 && len(cfg.Peering.Peers) == 0 {
523+
// Skip peer check if Bootstrap and Peering lists are empty
524+
// (means user disabled them on purpose)
525+
log.Warn("skipping bootstrap: empty Bootstrap and Peering lists")
526+
return
527+
}
518528
ipfs, err := coreapi.NewCoreAPI(node)
519529
if err != nil {
520530
log.Errorf("failed to access CoreAPI: %v", err)

0 commit comments

Comments
 (0)