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

This commit is contained in:
Marcin Rataj 2024-08-12 23:00:56 +02:00 committed by GitHub
parent 91ae982494
commit a339e6e807
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -597,6 +597,7 @@ take effect.
cfg, err := cctx.GetConfig()
if err != nil {
log.Errorf("failed to access config: %s", err)
return
}
if len(cfg.Bootstrap) == 0 && len(cfg.Peering.Peers) == 0 {
// Skip peer check if Bootstrap and Peering lists are empty
@ -607,10 +608,12 @@ take effect.
ipfs, err := coreapi.NewCoreAPI(node)
if err != nil {
log.Errorf("failed to access CoreAPI: %v", err)
return
}
peers, err := ipfs.Swarm().Peers(cctx.Context())
if err != nil {
log.Errorf("failed to read swarm peers: %v", err)
return
}
if len(peers) == 0 {
log.Error("failed to bootstrap (no peers found): consider updating Bootstrap or Peering section of your config")