Skip to content

Commit f507f5b

Browse files
do not broadcast / bump / cpfp commitment if manual_broadcast=true and funding_tx is not broadcasted yet
1 parent 0051b10 commit f507f5b

File tree

4 files changed

+709
-20
lines changed

4 files changed

+709
-20
lines changed

lightning-liquidity/src/lsps2/service.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,9 +1023,9 @@ where
10231023
/// were being held for that JIT channel are forwarded. In a `client_trusts_lsp` flow, once
10241024
/// the fee has been fully paid, the channel's funding transaction will be broadcasted.
10251025
///
1026-
/// Note that `next_channel_id` and `skimmed_fee_msat` are required to be provided. Therefore, the corresponding
1027-
/// [`Event::PaymentForwarded`] events need to be generated and serialized by LDK versions
1028-
/// greater or equal to 0.0.122.
1026+
/// Note that `next_channel_id` and `skimmed_fee_msat` are required to be provided.
1027+
/// Therefore, the corresponding [`Event::PaymentForwarded`] events need to be generated and
1028+
/// serialized by LDK versions greater or equal to 0.0.122.
10291029
///
10301030
/// [`Event::PaymentForwarded`]: lightning::events::Event::PaymentForwarded
10311031
pub fn payment_forwarded(
@@ -1595,6 +1595,13 @@ where
15951595
/// Stores the funding transaction for a JIT channel.
15961596
///
15971597
/// Call this when the funding transaction is created.
1598+
///
1599+
/// In `client_trusts_lsp` the broadcasting of the funding transaction will be handled internally
1600+
/// after you also mark it as broadcast-safe via
1601+
/// [`set_funding_tx_broadcast_safe`] and once the opening fee has been collected. You do not need
1602+
/// to broadcast the funding transaction yourself in this flow.
1603+
///
1604+
/// [`set_funding_tx_broadcast_safe`]: Self::set_funding_tx_broadcast_safe
15981605
pub fn store_funding_transaction(
15991606
&self, user_channel_id: u128, counterparty_node_id: &PublicKey, funding_tx: Transaction,
16001607
) -> Result<(), APIError> {
@@ -1640,7 +1647,8 @@ where
16401647
/// the intercepted payment.
16411648
///
16421649
/// In a `client_trusts_lsp` flow, after this is set and the opening fee has been fully skimmed,
1643-
/// the channel's funding transaction will be broadcasted.
1650+
/// the channel's funding transaction will be broadcasted if the channel is still usable.
1651+
/// If the channel has been closed or force-closed before this point, the funding transaction will not be broadcasted.
16441652
///
16451653
/// [`Event::FundingTxBroadcastSafe`]: lightning::events::Event::FundingTxBroadcastSafe
16461654
pub fn set_funding_tx_broadcast_safe(

0 commit comments

Comments
 (0)