1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-02 02:11:13 +08:00

swap net2 -> net

This commit is contained in:
Juan Batiz-Benet
2015-01-01 12:45:39 -08:00
parent 128e820ccb
commit 8fb5cf9578
91 changed files with 411 additions and 6460 deletions

View File

@ -51,11 +51,11 @@ ipfs swarm peers lists the set of peers this node is connected to.
return nil, err
}
if n.Network == nil {
if n.PeerHost == nil {
return nil, errNotOnline
}
conns := n.Network.Conns()
conns := n.PeerHost.Network().Conns()
addrs := make([]string, len(conns))
for i, c := range conns {
pid := c.RemotePeer()
@ -95,7 +95,7 @@ ipfs swarm connect /ip4/104.131.131.82/tcp/4001/QmaCpDMGvV2BGHeYERUEnRQAwe3N8Szb
addrs := req.Arguments()
if n.Network == nil {
if n.PeerHost == nil {
return nil, errNotOnline
}
@ -108,7 +108,7 @@ ipfs swarm connect /ip4/104.131.131.82/tcp/4001/QmaCpDMGvV2BGHeYERUEnRQAwe3N8Szb
for i, p := range peers {
output[i] = "connect " + p.Pretty()
err := n.Network.DialPeer(ctx, p)
err := n.PeerHost.Connect(ctx, peer.PeerInfo{ID: p})
if err != nil {
output[i] += " failure: " + err.Error()
} else {