Remove unneeded check of closed channel.

This commit is contained in:
Josh Rickmar 2014-06-18 09:16:14 -05:00
parent 6a72a0ad4d
commit a87f827fb9

View file

@ -1047,16 +1047,13 @@ func (s *Store) UnspentOutputs() ([]Credit, error) {
i++ i++
} }
unspent := make([]Credit, 0, len(s.unspent)) unspent := make([]Credit, len(s.unspent))
for _, c := range creditChans { for i, c := range creditChans {
cc, ok := <-c cc := <-c
if !ok {
continue
}
if cc.err != nil { if cc.err != nil {
return nil, cc.err return nil, cc.err
} }
unspent = append(unspent, cc.credit) unspent[i] = cc.credit
} }
for _, r := range s.unconfirmed.txs { for _, r := range s.unconfirmed.txs {