From 2768f3ea3d766bbd1c8cb34f9d5a5b42f837172c Mon Sep 17 00:00:00 2001 From: Jesse Li Date: Sat, 4 Jan 2020 11:01:01 -0500 Subject: [PATCH] Remove buffering from results channel --- p2p/p2p.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p2p/p2p.go b/p2p/p2p.go index 32bbc6b..bdb3123 100644 --- a/p2p/p2p.go +++ b/p2p/p2p.go @@ -187,7 +187,7 @@ func (t *Torrent) Download() ([]byte, error) { log.Println("Starting download for", t.Name) // Init queues for workers to retrieve work and send results workQueue := make(chan *pieceWork, len(t.PieceHashes)) - results := make(chan *pieceResult, len(t.PieceHashes)) + results := make(chan *pieceResult) for index, hash := range t.PieceHashes { length := t.calculatePieceSize(index) workQueue <- &pieceWork{index, hash, length}