提交 36ce8a28 作者: Brian Tiger Chow

chore(bitswap) rm halt chan since bitswap has no daemon

上级 2dc8bc83
...@@ -49,11 +49,6 @@ type bitswap struct { ...@@ -49,11 +49,6 @@ type bitswap struct {
// interact with partners. // interact with partners.
// TODO(brian): save the strategist's state to the datastore // TODO(brian): save the strategist's state to the datastore
strategist strategy.Strategist strategist strategy.Strategist
// haveList is the set of keys we have values for. a map for fast lookups.
// haveList KeySet -- not needed. all values in datastore?
haltChan chan struct{}
} }
// NewSession initializes a bitswap session. // NewSession initializes a bitswap session.
...@@ -66,7 +61,6 @@ func NewSession(parent context.Context, s bsnet.NetworkService, p *peer.Peer, d ...@@ -66,7 +61,6 @@ func NewSession(parent context.Context, s bsnet.NetworkService, p *peer.Peer, d
blockstore: blockstore.NewBlockstore(d), blockstore: blockstore.NewBlockstore(d),
routing: directory, routing: directory,
sender: bsnet.NewNetworkAdapter(s, &receiver), sender: bsnet.NewNetworkAdapter(s, &receiver),
haltChan: make(chan struct{}),
notifications: notifications.New(), notifications: notifications.New(),
} }
receiver.Delegate(bs) receiver.Delegate(bs)
...@@ -156,10 +150,6 @@ func (bs *bitswap) send(p *peer.Peer, b blocks.Block) { ...@@ -156,10 +150,6 @@ func (bs *bitswap) send(p *peer.Peer, b blocks.Block) {
bs.strategist.MessageSent(p, message) bs.strategist.MessageSent(p, message)
} }
func (bs *bitswap) Halt() {
bs.haltChan <- struct{}{}
}
// TODO(brian): handle errors // TODO(brian): handle errors
func (bs *bitswap) ReceiveMessage( func (bs *bitswap) ReceiveMessage(
ctx context.Context, sender *peer.Peer, incoming bsmsg.BitSwapMessage) ( ctx context.Context, sender *peer.Peer, incoming bsmsg.BitSwapMessage) (
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论