@cryptotaxi247 / kubo / commits / a339e6e80

fix(daemon): panic in kubo/daemon.go:595 (#10473)

Marcin Rataj committed Aug 12, 2024 at 23:00 UTC a339e6e807fa5bde786e5a539b2958a15ea22125
1 file changed +3
cmd/ipfs/kubo/daemon.go
+3
@@ -597,6 +597,7 @@ take effect.
597 cfg, err := cctx.GetConfig()
598 if err != nil {
599 log.Errorf("failed to access config: %s", err)
600 + return
601 }
602 if len(cfg.Bootstrap) == 0 && len(cfg.Peering.Peers) == 0 {
603 // Skip peer check if Bootstrap and Peering lists are empty
@@ -607,10 +608,12 @@ take effect.
608 ipfs, err := coreapi.NewCoreAPI(node)
609 if err != nil {
610 log.Errorf("failed to access CoreAPI: %v", err)
611 + return
612 }
613 peers, err := ipfs.Swarm().Peers(cctx.Context())
614 if err != nil {
615 log.Errorf("failed to read swarm peers: %v", err)
616 + return
617 }
618 if len(peers) == 0 {
619 log.Error("failed to bootstrap (no peers found): consider updating Bootstrap or Peering section of your config")