lnwallet: use two-value read from conf channel to detect closure

This commit is contained in:
Olaoluwa Osuntokun 2016-07-14 16:17:01 -07:00
parent 32e5de301d
commit a14246c5bb
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2

@ -1277,7 +1277,16 @@ func (l *LightningWallet) openChannelAfterConfirmations(res *ChannelReservation)
// or the wallet signals a shutdown.
out:
select {
case <-confNtfn.Confirmed:
case _, ok := <-confNtfn.Confirmed:
// Reading a falsey value for the second parameter indicates that
// the notifier is in the process of shutting down. Therefore, we
// don't count this as the signal that the funding transaction has
// been confirmed.
if !ok {
res.chanOpen <- nil
return
}
break out
case <-l.quit:
res.chanOpen <- nil