fix: use send-all fee estimation for max channel fundable amount#475
Merged
fix: use send-all fee estimation for max channel fundable amount#475
Conversation
maxChannelFundableAmount() passes the full onchain balance as the send amount to calculateTotalFee(), which creates a change output that falls below the dust limit (546 sats) when balance ≈ amount + fees. This causes ldk-node's coin selection to fail with "CoinSelectionFailed". Use estimateSendAllFee() instead, which builds a drain transaction with no change output — the correct API for computing "balance minus fees". Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ben-kaufman
previously approved these changes
Mar 5, 2026
Add --comment flag to prompt so review output is posted as PR comments instead of discarded. Add --allowedTools to permit gh/git commands. Add concurrency group to cancel redundant runs on force-pushes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ben-kaufman
approved these changes
Mar 5, 2026
pwltr
approved these changes
Mar 5, 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.
Summary
maxChannelFundableAmount()was usingcalculateTotalFee()with the full onchain balance as the send amount. When balance ≈ amount + fees, the change output falls below the dust limit (546 sats), causing ldk-node's coin selection to reject withCoinSelectionFailed.estimateSendAllFee(), which builds a drain transaction (no change output) — the correct API for computing "balance minus fees".--commentflag and--allowedToolsso reviews are posted as PR comments instead of silently discarded; add concurrency group to cancel redundant runs on force-pushes. (workflow changes take effect on PRs opened after merge)chore/bump-ldk-nodebranch).Test plan
channelFundableBalanceSatsshows a reasonable value (balance minus estimated fee)🤖 Generated with Claude Code