Skip to content

Commit

Permalink
x - debug chan status manager
Browse files Browse the repository at this point in the history
  • Loading branch information
yyforyongyu committed Dec 4, 2024
1 parent 3eb8db7 commit 03757d2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions netann/chan_status_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ func (m *ChanStatusManager) Stop() error {
func (m *ChanStatusManager) RequestEnable(outpoint wire.OutPoint,
manual bool) error {

log.Debugf("Requesting enable for channel %v", outpoint)

return m.submitRequest(m.enableRequests, outpoint, manual)
}

Expand All @@ -278,13 +280,18 @@ func (m *ChanStatusManager) RequestEnable(outpoint wire.OutPoint,
func (m *ChanStatusManager) RequestDisable(outpoint wire.OutPoint,
manual bool) error {

log.Debugf("Requesting disable channel %v", outpoint)

return m.submitRequest(m.disableRequests, outpoint, manual)
}

// RequestAuto submits a request to restore automatic channel state management.
// If the channel is in the state ChanStatusManuallyDisabled, it will be moved
// back to the state ChanStatusDisabled. Otherwise, no action will be taken.
func (m *ChanStatusManager) RequestAuto(outpoint wire.OutPoint) error {

log.Debugf("Requesting auto for channel %v", outpoint)

return m.submitRequest(m.autoRequests, outpoint, true)
}

Expand Down Expand Up @@ -352,6 +359,8 @@ func (m *ChanStatusManager) statusManager() {

// Use long-polling to detect when channels become inactive.
case <-m.statusSampleTicker.C:
log.Debug("Sampling channel statuses")

// First, do a sweep and mark any ChanStatusEnabled
// channels that are not active within the htlcswitch as
// ChanStatusPendingDisabled. The channel will then be
Expand Down

0 comments on commit 03757d2

Please sign in to comment.