@cryptotaxi247 / kubo / commits / 63c0d4161

fix(core): perform sophisticated boostrap operation

Brian Tiger Chow committed Jan 10, 2015 at 23:23 UTC 63c0d41614a56cdc88a0b4a1ebf94c3b5970df67
1 file changed +5 -6
core/core.go
+5 -6
@@ -269,14 +269,13 @@ func (n *IpfsNode) Resolve(k util.Key) (*merkledag.Node, error) {
269 return (&path.Resolver{n.DAG}).ResolvePath(k.String())
270 }
271
272 +// Bootstrap is undefined when node is not in OnlineMode
273 func (n *IpfsNode) Bootstrap(ctx context.Context, peers []peer.PeerInfo) error {
274 +
275 + // TODO what should return value be when in offlineMode?
276 +
277 if n.DHT != nil {
274 - for _, p := range peers {
275 - // TODO bootstrap(ctx, n.PeerHost, n.DHT, n.Peerstore, peers)
276 - if err := n.DHT.Connect(ctx, p.ID); err != nil {
277 - return err
278 - }
279 - }
278 + return bootstrap(ctx, n.PeerHost, n.DHT, n.Peerstore, peers)
279 }
280 return nil
281 }