Skip to content

Commit 714e42f

Browse files
committed
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.
1 parent f525d31 commit 714e42f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

netann/chan_status_manager.go

+12
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,18 @@ func (m *ChanStatusManager) disableInactiveChannels() {
466466
if err != nil {
467467
log.Errorf("Unable to sign update disabling "+
468468
"channel(%v): %v", outpoint, err)
469+
470+
// If the edge was not found, this is a likely indicator
471+
// that the channel has been closed. Thus we remove the
472+
// outpoint from the set of tracked outpoints to prevent
473+
// further attempts.
474+
if err == channeldb.ErrEdgeNotFound {
475+
log.Debugf("Removing channel(%v) from "+
476+
"consideration for passive disabling",
477+
outpoint)
478+
delete(m.chanStates, outpoint)
479+
}
480+
469481
continue
470482
}
471483

0 commit comments

Comments
 (0)