Repository navigation
Fix reachable unwrap of outbound_htlc_minimum_msat - #211
Merged
tnull merged 1 commit intoNov 27, 2023
Merged
Conversation
As the `unwrap` previously was reachable we now expose the field as an `Option`. Additionally, we document the unwrap safety of the other `ChannelDetails` fields where applicable.
tnull
force-pushed
the
2023-11-fix-reachable-chandetails-unwrap
branch
from
November 27, 2023 13:01
492762e to
d09c572
Compare
jbesraa
added a commit
to blocknil/ldk-node
that referenced
this pull request
Nov 28, 2026
…nfirmed_unlocked_amount_sats Follow-up to the previous commit, the same patch. The wallet's sum becomes upstream's Wallet::get_confirmed_unlocked_amount_sats (ldk-node lightningdevkit#1223, 6fb3d52) word for word, taken alone with its unit test, so that the Blocknil part is the public wrapper (Node::confirmed_spendable_onchain_balance_sats, less the anchor reserve) and moving to upstream drops the copy. Upstream's sum leaves out what ours also skipped (immature coinbase outputs, a coin whose transaction is too large for tx_add_input); neither is on a provider's wallet, and either would only make the figure higher than coin selection can use, as before lightningdevkit#211's fix. The rest of lightningdevkit#1223 (the splice anchor-reserve checks) isn't taken: it conflicts with our change-keeping splice_in in splice_channel. Tests: confirmed_unlocked_amount_does_not_depend_on_seeing_a_splice (upstream's; the splice is signed here for bdk_wallet 3.2.1, ldk3-bdk-3.2.1). The integration test drops its "in a block but not synced" assertion: the node's background sync can run first, so it raced (failed once).
jbesraa
added a commit
to blocknil/ldk-node
that referenced
this pull request
Nov 28, 2026
…nd a reserve refusal in splice_in_with_change as InsufficientFunds From the review of r11, for the provider's splice on arrival (bitcoin-wallet lightningdevkit#211). - Node::confirmed_spendable_utxo_values: the value of each coin confirmed_spendable_onchain_balance_sats counts (Wallet::get_confirmed_unlocked_utxo_values, the filter of upstream's get_confirmed_unlocked_amount_sats). The provider sized a splice's fee for a flat 300 vB, so a wallet of many small coins was quoted, then refused after the customer's yes; with the values it can size the fee for the coins selection would use, largest first. - In splice_in_inner's Exact arm, when keep_change (splice_in_with_change), the anchor-reserve check after coin selection (upstream lightningdevkit#1223) fails with InsufficientFunds, as that method does when no coins leave change. It returned ChannelSplicingFailed, which a caller can't tell from a splice that can't start. Upstream's splice_in keeps ChannelSplicingFailed. Tests: splice_in_with_change_reports_a_fee_into_the_anchor_reserve_as_insufficient_funds (fails with ChannelSplicingFailed without the mapping, checked) and confirmed_spendable_balance_leaves_out_unconfirmed_change, which now also checks the values at each step.
jbesraa
added a commit
to blocknil/ldk-node
that referenced
this pull request
Nov 28, 2026
…nnounce in tx_add_input Coin selection for a splice marks unspendable a coin whose previous transaction is too large to carry in a tx_add_input (fits_tx_add_input). get_confirmed_unlocked_utxo_values listed it anyway, and so did the balance the provider checks, so a provider funded by a large batch payment could quote a splice on that coin and have it refused after the customer's yes. The values now use the same filter, and confirmed_spendable_onchain_balance_sats is their sum (less the anchor reserve), so the provider's two figures agree. Upstream's get_confirmed_unlocked_amount_sats, which its own splice checks use, is unchanged. The docs say smallest first, as the provider sizes it. Test: confirmed_unlocked_utxo_values_leave_out_coins_too_large_to_announce fails without the filter (both coins listed). Review of r11 (bitcoin-wallet lightningdevkit#211).
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 #208.
As the
unwrappreviously was reachable we now expose the field as anOption. Additionally, we document the unwrap safety of the otherChannelDetailsfields where applicable.