GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — staticaddr/loopin: keep watching the timeout sweep after a notifier error by claravanstaden · Pull Request #1305 · lightninglabs/loop

Conversation

@claravanstaden

@claravanstaden claravanstaden commented Nov 24, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

A static address loop-in that waits for its published HTLC timeout sweep to confirm moved to Failed when the chain notifier failed to register the confirmation watch or reported an error on it. The refund was already published at that point.

Fix

  • Helper: utils.WatchConfirmation watches one transaction until it confirms. It registers again after a delay when the registration or the stream fails, and stops when the caller cancels. The confirmation arrives on a channel, so a caller can select on several watches and on other events while a watch reconnects. It takes a clock for the retry delay and a callback per failed attempt, so the caller decides how to log. A missing retry delay defaults to 10 seconds.
  • First user: MonitorHtlcTimeoutSweepAction watches the timeout sweep with the helper and retries every 10 seconds. It logs a warning on the first failure and then about every five minutes. The loop-in config gets an optional Clock for tests.

The helper is meant to be reused by other confirmation watches, in this repo and by the server, which have the same pattern.

Tests

  • TestWatchConfirmation: the watch passes its parameters to the notifier, delivers the confirmation and releases the registration.
  • TestWatchConfirmationRetries: a registration error, a stream error, a closed channel and a nil confirmation each lead to a new registration after the delay, and the confirmation is still delivered.
  • TestWatchConfirmationStopsOnCancel: a canceled watch doesn't report an error or register again.
  • TestWatchConfirmationDefaultDelay: a watch without a retry delay waits for the default delay.
  • TestWatchConfirmationDefaultClock: the watch works without a clock.
  • TestMonitorHtlcTimeoutSweepActionRetriesNotifierError: registration and stream errors don't end the action, and the confirmation that follows finalizes the deposits. Fails with the old action body (OnError).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@claravanstaden
claravanstaden force-pushed the conf-watch-retry branch from 69fe044 to 7822fd3 Compare November 24, 2026 08:12
@claravanstaden claravanstaden self-assigned this Nov 24, 2026
@claravanstaden claravanstaden added the static-loop-in label Nov 24, 2026
@claravanstaden
claravanstaden force-pushed the conf-watch-retry branch 3 times, most recently from da2af4a to cd0055d Compare November 25, 2026 11:07
claravanstaden added 2 commits November 27, 2026 21:13
@claravanstaden
utils: add a confirmation watch that survives notifier errors
0a6608c
A confirmation watch ends when the chain notifier fails to register it
or reports an error on its stream. Callers that treat this as fatal
abandon a transaction they already published.

WatchConfirmation watches one transaction until it confirms. It
registers again after a delay when the registration or the stream
fails, and stops when the caller cancels. The confirmation arrives on a
channel, so a caller can select on several watches and on other events
while a watch reconnects.
@claravanstaden
staticaddr/loopin: keep watching the timeout sweep after an error
d2979b5
MonitorHtlcTimeoutSweepAction moved the loop-in to Failed when the
chain notifier failed to register the confirmation watch or reported an
error on it. The refund is already published at that point, so the
deposits were left in a failed swap although they were being swept
back.

Watch the confirmation with utils.WatchConfirmation, which registers
again after a delay.
@claravanstaden
claravanstaden force-pushed the conf-watch-retry branch from cd0055d to d2979b5 Compare November 27, 2026 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@claravanstaden claravanstaden

Labels

static-loop-in

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@claravanstaden
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.