提交 e40e5699 作者: Jeromy

use a routedHost in the core node constructor

上级 ee1450bf
...@@ -21,6 +21,7 @@ import ( ...@@ -21,6 +21,7 @@ import (
ic "github.com/jbenet/go-ipfs/p2p/crypto" ic "github.com/jbenet/go-ipfs/p2p/crypto"
p2phost "github.com/jbenet/go-ipfs/p2p/host" p2phost "github.com/jbenet/go-ipfs/p2p/host"
p2pbhost "github.com/jbenet/go-ipfs/p2p/host/basic" 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" swarm "github.com/jbenet/go-ipfs/p2p/net/swarm"
addrutil "github.com/jbenet/go-ipfs/p2p/net/swarm/addr" addrutil "github.com/jbenet/go-ipfs/p2p/net/swarm/addr"
peer "github.com/jbenet/go-ipfs/p2p/peer" peer "github.com/jbenet/go-ipfs/p2p/peer"
...@@ -236,6 +237,8 @@ func (n *IpfsNode) startOnlineServices(ctx context.Context, routingOption Routin ...@@ -236,6 +237,8 @@ func (n *IpfsNode) startOnlineServices(ctx context.Context, routingOption Routin
return err return err
} }
n.PeerHost = rhost.Wrap(peerhost, n.Routing)
// Ok, now we're ready to listen. // Ok, now we're ready to listen.
if err := startListening(ctx, n.PeerHost, n.Repo.Config()); err != nil { if err := startListening(ctx, n.PeerHost, n.Repo.Config()); err != nil {
return debugerror.Wrap(err) return debugerror.Wrap(err)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论