From a87f827fb9ce52895d3711a4474635d77fdf89b6 Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Wed, 18 Jun 2014 09:16:14 -0500 Subject: [PATCH] Remove unneeded check of closed channel. --- txstore/tx.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/txstore/tx.go b/txstore/tx.go index 262e48f..00b7549 100644 --- a/txstore/tx.go +++ b/txstore/tx.go @@ -1047,16 +1047,13 @@ func (s *Store) UnspentOutputs() ([]Credit, error) { i++ } - unspent := make([]Credit, 0, len(s.unspent)) - for _, c := range creditChans { - cc, ok := <-c - if !ok { - continue - } + unspent := make([]Credit, len(s.unspent)) + for i, c := range creditChans { + cc := <-c if cc.err != nil { return nil, cc.err } - unspent = append(unspent, cc.credit) + unspent[i] = cc.credit } for _, r := range s.unconfirmed.txs {