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

use a routedHost in the core node constructor

This commit is contained in:
Jeromy
2015-02-14 06:54:06 +00:00
parent ee1450bf9e
commit e40e5699f9

View File

@ -21,6 +21,7 @@ import (
ic "github.com/jbenet/go-ipfs/p2p/crypto"
p2phost "github.com/jbenet/go-ipfs/p2p/host"
p2pbhost "github.com/jbenet/go-ipfs/p2p/host/basic"
rhost "github.com/jbenet/go-ipfs/p2p/host/routed"
swarm "github.com/jbenet/go-ipfs/p2p/net/swarm"
addrutil "github.com/jbenet/go-ipfs/p2p/net/swarm/addr"
peer "github.com/jbenet/go-ipfs/p2p/peer"
@ -236,6 +237,8 @@ func (n *IpfsNode) startOnlineServices(ctx context.Context, routingOption Routin
return err
}
n.PeerHost = rhost.Wrap(peerhost, n.Routing)
// Ok, now we're ready to listen.
if err := startListening(ctx, n.PeerHost, n.Repo.Config()); err != nil {
return debugerror.Wrap(err)