netann/chan_status_manager: remove unknown edges from passive disable

Modifies the netann.ChanStatusManager to remove outpoints
from the set of tracked channels when it encounters a
channeldb.ErrEdgeNotFound when passively disabling. It is
possible for this to occur if a channel is closed w/o first
being disabled, which may happen if the remote party force
closes.
This commit is contained in:
Conner Fromknecht 2019-03-12 17:35:12 -07:00
parent f525d313b2
commit 714e42fce2
No known key found for this signature in database
GPG Key ID: E7D737B67FA592C7

View File

@ -466,6 +466,18 @@ func (m *ChanStatusManager) disableInactiveChannels() {
if err != nil {
log.Errorf("Unable to sign update disabling "+
"channel(%v): %v", outpoint, err)
// If the edge was not found, this is a likely indicator
// that the channel has been closed. Thus we remove the
// outpoint from the set of tracked outpoints to prevent
// further attempts.
if err == channeldb.ErrEdgeNotFound {
log.Debugf("Removing channel(%v) from "+
"consideration for passive disabling",
outpoint)
delete(m.chanStates, outpoint)
}
continue
}