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.
This commit is contained in:
parent
596a3154c1
commit
807379661c
1 changed files with 1 additions and 1 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue