Conversation
There was a problem hiding this comment.
💡 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".
| 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}"), | ||
| } |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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 👍 / 👎.
No description provided.