peer: always load active channels upon connection reestablishment with peer

In this commit, we modify the logic within loadActiveChannels to
*always* load a channel, even if it isn’t yet fully confirmed. With
this change, we ensure that we’ll always send a channel_reestablish
message upon reconnection.

Fixes #458.
This commit is contained in:
Olaoluwa Osuntokun 2017-12-06 16:29:35 -08:00
parent 7b10f54216
commit 084d477ec3
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21

@ -294,12 +294,6 @@ func (p *peer) Start() error {
// channels returned by the database.
func (p *peer) loadActiveChannels(chans []*channeldb.OpenChannel) error {
for _, dbChan := range chans {
// If the channel isn't yet open, then we don't need to process
// it any further.
if dbChan.IsPending {
continue
}
lnChan, err := lnwallet.NewLightningChannel(p.server.cc.signer,
p.server.cc.chainNotifier, p.server.cc.feeEstimator, dbChan)
if err != nil {