Skip to content

fix: use send-all fee for channel funding#823

Merged
ovitrif merged 1 commit intomasterfrom
fix/use-send-all-fee-est
Mar 5, 2026
Merged

fix: use send-all fee for channel funding#823
ovitrif merged 1 commit intomasterfrom
fix/use-send-all-fee-est

Conversation

@ovitrif
Copy link
Collaborator

@ovitrif ovitrif commented Mar 5, 2026

This PR fixes the fee estimation for channel funding when using the full onchain balance.

Description

getMaxChannelFundableAmount() was using calculateTotalFee() which builds a regular transaction and fails with "Coin selection failed" when funding a channel with the entire balance (produces dust change). This switches to estimateSendAllFee() which is designed for drain transactions, matching the pattern already used in getMaxSendAmount().

Preview

No UI changes, fixes bug causing error in logs about estimating fee for full wallet balance.

QA Notes

  1. Verify app logs don't show these errors anymore:
2026-03-05 13:16:46.100 ERROR   [ldk_node::wallet:1173]              Failed to create transaction: Coin selection failed
2026-03-05 13:16:46.101 WARN    [LightningService.kt:867]            Error calculating fee for 1000 sats to bcrt1pr0kc8wpe8x2pekxfzcfc5ax4p3ak5gwy25ushfp2f67fglkde67qflgpsa, null UTXOs, satsPerVByte=1 [OnchainTxCreationFailed='On-chain transaction could not be created.'] - LightningService
2026-03-05 13:16:46.104 WARN    [LightningRepo.kt:1107]              calculateTotalFee error, using fallback of '1000' [AppError='LDK Node error: Failed to create on-chain transaction.'] - LightningRepo

🤖 Generated with Claude Code

@ovitrif ovitrif requested review from ben-kaufman and jvsena42 March 5, 2026 13:52
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ovitrif ovitrif force-pushed the fix/use-send-all-fee-est branch from 2b67324 to 3a88156 Compare March 5, 2026 14:14
@ovitrif ovitrif enabled auto-merge March 5, 2026 14:16
@ovitrif ovitrif merged commit 362f7d0 into master Mar 5, 2026
22 checks passed
@ovitrif ovitrif deleted the fix/use-send-all-fee-est branch March 5, 2026 15:15
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.

2 participants