Skip to content

Add ability to open channel / splice with all on-chain funds#788

Merged
tnull merged 4 commits intolightningdevkit:mainfrom
benthecarman:open-channel-all
Mar 2, 2026
Merged

Add ability to open channel / splice with all on-chain funds#788
tnull merged 4 commits intolightningdevkit:mainfrom
benthecarman:open-channel-all

Conversation

@benthecarman
Copy link
Contributor

@benthecarman benthecarman commented Feb 10, 2026

Closes #777

Uses the same fee estimation logic that send_all_to_address uses which can be hack but it works today.

Tests generated with claude.

@benthecarman benthecarman requested a review from tnull February 10, 2026 23:59
@benthecarman benthecarman self-assigned this Feb 10, 2026
@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Feb 10, 2026

👋 Thanks for assigning @tnull as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@ldk-reviews-bot
Copy link

🔔 1st Reminder

Hey @tnull! This PR has been waiting for your review.
Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

@ldk-reviews-bot
Copy link

🔔 2nd Reminder

Hey @tnull! This PR has been waiting for your review.
Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

@benthecarman benthecarman force-pushed the open-channel-all branch 2 times, most recently from 9e1c88d to 86e2792 Compare February 17, 2026 07:22
@benthecarman
Copy link
Contributor Author

Responded to review. Also added commit for splicing in with all funds

@benthecarman benthecarman changed the title Add ability to open channel with all on-chain funds Add ability to open channel / splice with all on-chain funds Feb 17, 2026
tnull
tnull previously approved these changes Feb 24, 2026
Copy link
Collaborator

@tnull tnull left a comment

Choose a reason for hiding this comment

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

LGTM, some comments that can however happen in a short follow-up.

This needs a rebase by now, unfortunately.

…send

DRY up the repeated pattern of building a temporary drain transaction
to estimate fees. Both send_all_to_address (AllRetainingReserve) and
the upcoming open_channel_with_all / splice_in_with_all need this
logic, so extract it into shared helpers.
Adds open_channel_with_all which uses get_max_drain_amount to
determine the largest funding amount after accounting for on-chain fees
and anchor reserves
Adds splice_in_with_all which uses get_max_drain_amount with a
shared input to determine the largest splice-in amount after accounting
for on-chain fees and anchor reserves.
DRY up the anchor reserve calculation that was duplicated between
Node::new_channel_anchor_reserve_sats and the OpenChannelRequest
handler in event.rs.
@tnull tnull merged commit 1cf1e6f into lightningdevkit:main Mar 2, 2026
26 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

splice-in-all-onchain-funds API

3 participants