From 807379661cf0abe471267bfd4ea640404202234b Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Mon, 5 Jan 2015 19:54:06 -0500 Subject: [PATCH] Buffer a result channel. This will allow the worker goroutine to return even if one of the other workers has already errored, preventing these goroutines from lingering forever blocking on a channel send. --- txstore/tx.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/txstore/tx.go b/txstore/tx.go index 44cf647..15757c4 100644 --- a/txstore/tx.go +++ b/txstore/tx.go @@ -665,7 +665,7 @@ func (s *Store) findPreviousCredits(tx *btcutil.Tx) ([]Credit, error) { inputs := tx.MsgTx().TxIn creditChans := make([]chan createdCredit, len(inputs)) for i, txIn := range inputs { - creditChans[i] = make(chan createdCredit) + creditChans[i] = make(chan createdCredit, 1) go func(i int, op btcwire.OutPoint) { key, ok := s.unspent[op] if !ok {