Support hold invoices when receiving via JIT channels - #297
Merged
Merged
Conversation
|
👋 Thanks for assigning @benthecarman as a reviewer! |
f3r10
force-pushed
the
jit-hold-invoices
branch
from
September 24, 2026 23:49
e5b9665 to
10995ad
Compare
f3r10
force-pushed
the
jit-hold-invoices
branch
2 times, most recently
from
September 25, 2026 14:03
6933896 to
b22f567
Compare
benthecarman
requested changes
Sep 29, 2026
benthecarman
left a comment
Collaborator
There was a problem hiding this comment.
needs rebase, otherwise looks good
| #[test] | ||
| fn test_bolt11_receive_via_jit_channel_for_hash_unreachable() { | ||
| assert_unreachable_tool( | ||
| "bolt11_receive_variable_amount_via_jit_channel_for_hash", |
Collaborator
There was a problem hiding this comment.
should be bolt11_receive_via_jit_channel_for_hash?
Wrap ldk-node receive_via_jit_channel_for_hash and receive_variable_amount_via_jit_channel_for_hash as two new RPCs.
f3r10
force-pushed
the
jit-hold-invoices
branch
from
September 29, 2026 12:40
b22f567 to
33546ac
Compare
benthecarman
approved these changes
Sep 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #286.
We already had hold invoices (
Bolt11ReceiveForHash+ claim/fail) and JIT receive (Bolt11ReceiveViaJitChannel/Bolt11ReceiveVariableAmountViaJitChannel), but not both at once. A node with no inbound channel couldn't create a JIT invoice for a known payment hash and decide later whether to claim.This adds two RPCs that wrap the existing ldk-node methods (already on the pinned rev, no dependency bump):
Bolt11ReceiveViaJitChannelForHashBolt11ReceiveVariableAmountViaJitChannelForHashThey're separate RPCs, same split as
Bolt11Receive/Bolt11ReceiveForHash, rather than an optionalpayment_hashon the existing JIT requests. The two JIT modes take different fee-limit fields, so one combined message would make illegal combinations representable.Requests match the existing JIT ones plus
payment_hash. Responses are justinvoice. The payment is not auto-claimed; useBolt11ClaimForId/Bolt11FailForIdas with other hold invoices.manually_handle_unknown_bolt11_paymentswas already set.Also wired through the client, CLI, and MCP, and updated the hodl / JIT docs.
PaymentClaimablecomments now name all three hold-invoice RPCs.E2E: an ldk-server node with no channels, configured with the LSP as a liquidity source, creates a JIT hold invoice, gets paid through the LSP, then claims or fails. The existing JIT e2e used a raw ldk-node as the client; these tests use ldk-server in that role via a
TestConfigBuilderlsps_clientknob.