mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-30 18:13:54 +08:00
fix(core): perform sophisticated boostrap operation
This commit is contained in:
11
core/core.go
11
core/core.go
@ -269,14 +269,13 @@ func (n *IpfsNode) Resolve(k util.Key) (*merkledag.Node, error) {
|
|||||||
return (&path.Resolver{n.DAG}).ResolvePath(k.String())
|
return (&path.Resolver{n.DAG}).ResolvePath(k.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Bootstrap is undefined when node is not in OnlineMode
|
||||||
func (n *IpfsNode) Bootstrap(ctx context.Context, peers []peer.PeerInfo) error {
|
func (n *IpfsNode) Bootstrap(ctx context.Context, peers []peer.PeerInfo) error {
|
||||||
|
|
||||||
|
// TODO what should return value be when in offlineMode?
|
||||||
|
|
||||||
if n.DHT != nil {
|
if n.DHT != nil {
|
||||||
for _, p := range peers {
|
return bootstrap(ctx, n.PeerHost, n.DHT, n.Peerstore, peers)
|
||||||
// TODO bootstrap(ctx, n.PeerHost, n.DHT, n.Peerstore, peers)
|
|
||||||
if err := n.DHT.Connect(ctx, p.ID); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user