mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 10:27:46 +08:00
fix(daemon): panic in kubo/daemon.go:595 (#10473)
This commit is contained in:
parent
91ae982494
commit
a339e6e807
@ -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")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user