Skip to content

lwwallet: Complete spend lookups and report rescan completion - #1642

Open
sputn1ck wants to merge 3 commits into
mainfrom
kon/lwwallet-chain-observations
Open

sputn1ck wants to merge 3 commits into
mainfrom
kon/lwwallet-chain-observations

Conversation

@sputn1ck

@sputn1ck sputn1ck commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

This is the shared light wallet portion of the channel recovery stack, extracted against main. It changes light wallet behavior even without channels:

  • Spend registration completes its initial lookup before returning, so a caller that immediately checks for an already-confirmed spend can see it. A failed lookup now fails registration and removes the watch, allowing the caller to retry without treating an unknown spend as unspent. A registration waiting on another caller's raw transaction fetch can leave that shared wait on its own context deadline.
  • Esplora finishes a successful rescan with a terminal notification and rejects a start above the tip. This lets btcwallet distinguish a completed scan from a partial one.
  • Esplora maps Bitcoin Core rejection reasons to the typed errors used by the other wallet backends.

No channel APIs, runtime, protocol, Go module changes, or personal dependency replacements. The original wallet changes were extracted from #1191; the error propagation and shared-wait timeout fixes are review follow-ups. No new poller is introduced.

Local validation: go test ./lwwallet -count=1, go test -race ./lwwallet -run TestChainBackendSpendRegistrationSharedTxTimeout -count=1, make lint-changed-local, make fmt-changed, and make commitmsg-lint range='origin/main..HEAD'. Hosted CI runs separately on the pushed head.

Copilot AI balanced review requested due to automatic review settings November 24, 2026 16:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T16:49:57.985819Z 74b8aee PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 74b8aee054

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lwwallet/chain_backend.go Resolved
Deliver an already-known spend at registration and signal the last
block of an Esplora rescan. Map backend rejection reasons to typed
wallet errors so callers can distinguish confirmed and retryable work.
The transaction publisher immediately checks the spend channel after
registration. If the initial Esplora lookup fails, reporting a
successful empty registration can make it replace an already confirmed
sweep. Return the lookup error and remove that registration so the
caller can retry safely.
@sputn1ck
sputn1ck force-pushed the kon/lwwallet-chain-observations branch from 74b8aee to 3c9743e Compare November 26, 2026 17:20
Spend registration can join a raw transaction fetch started by a
background watcher. The first fetch may wait up to the HTTP client's
30-second timeout, beyond the registration actor's 10-second limit.
Let each caller leave the shared wait when its context expires.
@sputn1ck

Copy link
Copy Markdown
Member Author

/gateway review

@lightninglabs-gateway

lightninglabs-gateway Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

❌ gateway review failed: code-review skill failed across all auth modes: You've hit your org's monthly spend limit · ask your admin to raise it at https://claude.ai/admin-settings/usage · your 5-hour limit resets 12:30pm (UTC)

See workflow logs for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants