1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-29 01:12:24 +08:00

fix(bitswap:notifications) close chan on Publish

This commit is contained in:
Brian Tiger Chow
2014-09-12 02:44:53 -07:00
parent 7c378126f5
commit b1155a0bb6

View File

@ -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)