提交 85c533af 作者: Steven Allen

disable sending provider records from bitswap

License: MIT
Signed-off-by: 's avatarSteven Allen <steven@stebalien.com>
上级 3f6925df
...@@ -473,6 +473,14 @@ func (n *IpfsNode) HandlePeerFound(p pstore.PeerInfo) { ...@@ -473,6 +473,14 @@ func (n *IpfsNode) HandlePeerFound(p pstore.PeerInfo) {
} }
} }
type readOnlyProvider struct {
routing.ContentRouting
}
func (r readOnlyProvider) Provide(context.Context, cid.Cid, bool) error {
return nil
}
// startOnlineServicesWithHost is the set of services which need to be // startOnlineServicesWithHost is the set of services which need to be
// initialized with the host and _before_ we start listening. // initialized with the host and _before_ we start listening.
func (n *IpfsNode) startOnlineServicesWithHost(ctx context.Context, routingOption RoutingOption, enablePubsub bool, enableIpnsps bool) error { func (n *IpfsNode) startOnlineServicesWithHost(ctx context.Context, routingOption RoutingOption, enablePubsub bool, enableIpnsps bool) error {
...@@ -577,7 +585,7 @@ func (n *IpfsNode) startOnlineServicesWithHost(ctx context.Context, routingOptio ...@@ -577,7 +585,7 @@ func (n *IpfsNode) startOnlineServicesWithHost(ctx context.Context, routingOptio
} }
// setup exchange service // setup exchange service
bitswapNetwork := bsnet.NewFromIpfsHost(n.PeerHost, n.Routing) bitswapNetwork := bsnet.NewFromIpfsHost(n.PeerHost, readOnlyProvider{n.Routing})
n.Exchange = bitswap.New(ctx, bitswapNetwork, n.Blockstore) n.Exchange = bitswap.New(ctx, bitswapNetwork, n.Blockstore)
size, err := n.getCacheSize() size, err := n.getCacheSize()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论