peer: filter channels loaded into switch via whitelist
This is less brittle than blacklisting states since it may not be clear that new states needs to be added. Now that HasChanStatus is fixed for ChanStatusDefault, we can safely implement this.
This commit is contained in:
parent
93089aaaf8
commit
d6fa2f9092
10
peer.go
10
peer.go
@ -504,13 +504,9 @@ func (p *peer) loadActiveChannels(chans []*channeldb.OpenChannel) (
|
||||
// Skip adding any permanently irreconcilable channels to the
|
||||
// htlcswitch.
|
||||
switch {
|
||||
case dbChan.HasChanStatus(channeldb.ChanStatusBorked):
|
||||
fallthrough
|
||||
case dbChan.HasChanStatus(channeldb.ChanStatusCommitBroadcasted):
|
||||
fallthrough
|
||||
case dbChan.HasChanStatus(channeldb.ChanStatusCoopBroadcasted):
|
||||
fallthrough
|
||||
case dbChan.HasChanStatus(channeldb.ChanStatusLocalDataLoss):
|
||||
case !dbChan.HasChanStatus(channeldb.ChanStatusDefault) &&
|
||||
!dbChan.HasChanStatus(channeldb.ChanStatusRestored):
|
||||
|
||||
peerLog.Warnf("ChannelPoint(%v) has status %v, won't "+
|
||||
"start.", chanPoint, dbChan.ChanStatus())
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user