1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-09 19:32:24 +08:00

don't link when creating network client. rely on caller

This commit is contained in:
Brian Tiger Chow
2014-12-24 09:26:53 -05:00
parent 075841c118
commit 237e594a8f
2 changed files with 2 additions and 5 deletions

View File

@ -20,14 +20,10 @@ func StreamNet(ctx context.Context, net mockpeernet.Mocknet, rs mockrouting.Serv
}
func (pn *peernet) Adapter(p testutil.Peer) bsnet.BitSwapNetwork {
peers := pn.Mocknet.Peers()
client, err := pn.Mocknet.AddPeer(p.PrivateKey(), p.Address())
if err != nil {
panic(err.Error())
}
for _, other := range peers {
pn.Mocknet.LinkPeers(p.ID(), other)
}
routing := pn.routingserver.ClientWithDatastore(context.TODO(), p, ds.NewMapDatastore())
return bsnet.NewFromIpfsNetwork(client, routing)
}