Skip to content

Support bolt12 lsps4 receive#25

Merged
martinsaposnic merged 1 commit intomainfrom
support-bolt12-lsps4
Feb 6, 2026
Merged

Support bolt12 lsps4 receive#25
martinsaposnic merged 1 commit intomainfrom
support-bolt12-lsps4

Conversation

@martinsaposnic
Copy link
Contributor

No description provided.

Copy link

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

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: 828f05ce4a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +917 to +920
match self.node.sync_rgs(true).await {
Ok(ts) => eprintln!("[lightning-js] RGS sync complete, timestamp={ts}"),
Err(e) => eprintln!("[lightning-js] RGS sync failed: {e}"),
}

Choose a reason for hiding this comment

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

P1 Badge Propagate BOLT12 setup sync failures

setup_bolt12_receive logs sync_rgs(true) errors but still returns success, so callers like get_bolt12_offer_while_running cannot detect that setup failed and will continue returning offers as if the node were ready. In environments where RGS sync is temporarily unavailable, this silently masks a hard setup failure and prevents retry/error handling at the API boundary.

Useful? React with 👍 / 👎.

.node
.bolt12_payment()
.receive_via_lsps4_jit_channel(
amount as u64,

Choose a reason for hiding this comment

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

P2 Badge Validate amount before unsigned cast

get_bolt12_offer_while_running converts a signed i64 amount to u64 with as, so a negative input from JS wraps to an enormous unsigned value instead of being rejected. This can generate nonsensical offer amounts or confusing downstream failures; reject non-positive values before conversion and return an input error.

Useful? React with 👍 / 👎.

@martinsaposnic martinsaposnic merged commit 9b57802 into main Feb 6, 2026
11 checks passed
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.

1 participant