peer: don't attempt to load any channels that have a non-default state, other then recovered
In this commit, we modify the filter we use to determine if we should add a new channel to the switch to reflect the new channel restoration state. For all other non-default states, we want to avoid loading in a channel, but for the restoration state, we need to load the link in order to ensure we initiate the data loss protection protocol once we connect to the remote peer.
This commit is contained in:
parent
f0e9a1f753
commit
73eb37b3a9
7
peer.go
7
peer.go
@ -438,7 +438,12 @@ func (p *peer) loadActiveChannels(chans []*channeldb.OpenChannel) error {
|
||||
|
||||
// Skip adding any permanently irreconcilable channels to the
|
||||
// htlcswitch.
|
||||
if dbChan.ChanStatus() != channeldb.ChanStatusDefault {
|
||||
switch {
|
||||
case dbChan.HasChanStatus(channeldb.ChanStatusBorked):
|
||||
fallthrough
|
||||
case dbChan.HasChanStatus(channeldb.ChanStatusCommitBroadcasted):
|
||||
fallthrough
|
||||
case dbChan.HasChanStatus(channeldb.ChanStatusLocalDataLoss):
|
||||
peerLog.Warnf("ChannelPoint(%v) has status %v, won't "+
|
||||
"start.", chanPoint, dbChan.ChanStatus())
|
||||
continue
|
||||
|
Loading…
Reference in New Issue
Block a user