提交 b1155a0b 作者: Brian Tiger Chow

fix(bitswap:notifications) close chan on Publish

上级 7c378126
......@@ -26,7 +26,7 @@ func (ps *notifications) Publish(block *blocks.Block) {
// |ctx| times out or is cancelled
func (ps *notifications) Subscribe(ctx context.Context, k u.Key) <-chan *blocks.Block {
topic := string(k)
subChan := ps.wrapped.Sub(topic)
subChan := ps.wrapped.SubOnce(topic)
blockChannel := make(chan *blocks.Block)
go func() {
defer close(blockChannel)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论