From b1155a0bb6cd0369ec59044868b39b7ace1c547d Mon Sep 17 00:00:00 2001 From: Brian Tiger Chow Date: Fri, 12 Sep 2014 02:44:53 -0700 Subject: [PATCH] fix(bitswap:notifications) close chan on Publish --- bitswap/notifications.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitswap/notifications.go b/bitswap/notifications.go index 9cf4d70e8..8277d160b 100644 --- a/bitswap/notifications.go +++ b/bitswap/notifications.go @@ -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)