Skip to content

Commit 50e8826

Browse files
committed
Mention user_channel_id uniqueness in invoice_params_generated docs
We update the docs of `invoice_params_generated` and mention that `user_channel_id` needs to be unique value.
1 parent b419925 commit 50e8826

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

lightning-liquidity/src/lsps2/service.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -757,12 +757,18 @@ where
757757
}
758758
}
759759

760-
/// Used by LSP to provide the client with the intercept scid and
761-
/// `cltv_expiry_delta` to include in their invoice. The intercept scid
762-
/// must be retrieved from [`ChannelManager::get_intercept_scid`].
760+
/// Used by LSP to provide the client with the intercept scid, a unique `user_channel_id`, and
761+
/// `cltv_expiry_delta` to include in their invoice.
762+
///
763+
/// The intercept scid must be retrieved from [`ChannelManager::get_intercept_scid`]. The given
764+
/// `user_channel_id` must be locally unique and will eventually be returned via events to be
765+
/// used when opening the channel via [`ChannelManager::create_channel`]. Note implementors
766+
/// will need to ensure their calls to [`ChannelManager::create_channel`] are idempotent based
767+
/// on this identifier.
763768
///
764769
/// Should be called in response to receiving a [`LSPS2ServiceEvent::BuyRequest`] event.
765770
///
771+
/// [`ChannelManager::create_channel`]: lightning::ln::channelmanager::ChannelManager::create_channel
766772
/// [`ChannelManager::get_intercept_scid`]: lightning::ln::channelmanager::ChannelManager::get_intercept_scid
767773
/// [`LSPS2ServiceEvent::BuyRequest`]: crate::lsps2::event::LSPS2ServiceEvent::BuyRequest
768774
#[allow(clippy::await_holding_lock)]
@@ -1815,7 +1821,7 @@ where
18151821
)
18161822
}
18171823

1818-
/// Used by LSP to provide the client with the intercept scid and
1824+
/// Used by LSP to provide the client with the intercept scid, a unique `user_channel_id`, and
18191825
/// `cltv_expiry_delta` to include in their invoice.
18201826
///
18211827
/// Wraps [`LSPS2ServiceHandler::invoice_parameters_generated`].

0 commit comments

Comments
 (0)