diff --git a/cluster.go b/cluster.go index c2cdbd9d..4a4f44f3 100644 --- a/cluster.go +++ b/cluster.go @@ -586,7 +586,12 @@ func (c *Cluster) ID() api.ID { addrs = append(addrs, multiaddrJoin(addr, c.id)) } - peers, _ := c.consensus.Peers() + peers := []peer.ID{} + // This method might get called very early by a remote peer + // and might catch us when consensus is not set + if c.consensus != nil { + peers, _ = c.consensus.Peers() + } return api.ID{ ID: c.id, diff --git a/ipfsconn/ipfshttp/config.go b/ipfsconn/ipfshttp/config.go index f050997d..dcb74820 100644 --- a/ipfsconn/ipfshttp/config.go +++ b/ipfsconn/ipfshttp/config.go @@ -17,7 +17,7 @@ const configKey = "ipfshttp" const ( DefaultProxyAddr = "/ip4/127.0.0.1/tcp/9095" DefaultNodeAddr = "/ip4/127.0.0.1/tcp/5001" - DefaultConnectSwarmsDelay = 7 * time.Second + DefaultConnectSwarmsDelay = 30 * time.Second DefaultProxyReadTimeout = 10 * time.Minute DefaultProxyReadHeaderTimeout = 5 * time.Second DefaultProxyWriteTimeout = 10 * time.Minute