Buffer response channel to prevent deadlock
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
Jeromy committed
Nov 12, 2017 at 19:21 UTC
332891f7b29be8525b8d5502837b91c00b89792d
1 file changed
+1
-1
exchange/bitswap/session.go
+1
-1
@@ -119,7 +119,7 @@ type interestReq struct {
119
// block we received) this function will not be called, as the cid will likely
120
// still be in the interest cache.
121
func (s *Session) isLiveWant(c *cid.Cid) bool {
122
- resp := make(chan bool)
122
+ resp := make(chan bool, 1)
123
s.interestReqs <- interestReq{
124
c: c,
125
resp: resp,