Skip to content

Commit

Permalink
fix: use short sync interval while LDK channel is waiting to become a…
Browse files Browse the repository at this point in the history
…ctive (#688)
  • Loading branch information
rolznz authored Sep 22, 2024
1 parent b2b0693 commit c3447e1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lnclient/ldk/ldk.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,15 @@ func NewLDKService(ctx context.Context, cfg config.Config, eventPublisher events
case <-time.After(MIN_SYNC_INTERVAL):
ls.syncing = true

channels := ls.node.ListChannels()
for _, channel := range channels {
if channel.Confirmations != nil && channel.ConfirmationsRequired != nil && *channel.Confirmations < *channel.ConfirmationsRequired {
logger.Logger.WithField("channel_id", channel.UserChannelId).Debug("Using short sync time while opening channel")
ls.lastWalletSyncRequest = time.Now()
break
}
}

if time.Since(ls.lastWalletSyncRequest) > MIN_SYNC_INTERVAL && time.Since(ls.lastFullSync) < MAX_SYNC_INTERVAL {

if time.Since(ls.lastFeeEstimatesSync) < MIN_FEE_ESTIMATES_SYNC_INTERVAL {
Expand Down

0 comments on commit c3447e1

Please sign in to comment.