@@ -776,8 +776,8 @@ pub struct ChannelDetails {
776
776
///
777
777
/// [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
778
778
pub unspendable_punishment_reserve : Option < u64 > ,
779
- /// The user_id passed in to create_channel, or 0 if the channel was inbound.
780
- pub user_id : u64 ,
779
+ /// The `user_channel_id` passed in to create_channel, or 0 if the channel was inbound.
780
+ pub user_channel_id : u64 ,
781
781
/// The available outbound capacity for sending HTLCs to the remote peer. This does not include
782
782
/// any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
783
783
/// available for inclusion in new outbound HTLCs). This further does not include any pending
@@ -1272,11 +1272,12 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
1272
1272
1273
1273
/// Creates a new outbound channel to the given remote node and with the given value.
1274
1274
///
1275
- /// `user_id` will be provided back as `user_channel_id` in [`Event::FundingGenerationReady`]
1276
- /// to allow tracking of which events correspond with which `create_channel` call. Note that
1277
- /// the `user_channel_id` defaults to 0 for inbound channels, so you may wish to avoid using 0
1278
- /// for `user_id` here. `user_id` has no meaning inside of LDK, it is simply copied to events
1279
- /// and otherwise ignored.
1275
+ /// `user_channel_id` will be provided back as in
1276
+ /// [`Event::FundingGenerationReady::user_channel_id`] to allow tracking of which events
1277
+ /// correspond with which `create_channel` call. Note that the `user_channel_id` defaults to 0
1278
+ /// for inbound channels, so you may wish to avoid using 0 for `user_channel_id` here.
1279
+ /// `user_channel_id` has no meaning inside of LDK, it is simply copied to events and otherwise
1280
+ /// ignored.
1280
1281
///
1281
1282
/// Raises [`APIError::APIMisuseError`] when `channel_value_satoshis` > 2**24 or `push_msat` is
1282
1283
/// greater than `channel_value_satoshis * 1k` or `channel_value_satoshis < 1000`.
@@ -1292,10 +1293,10 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
1292
1293
/// one derived from the funding transaction's TXID. If the counterparty rejects the channel
1293
1294
/// immediately, this temporary ID will appear in [`Event::ChannelClosed::channel_id`].
1294
1295
///
1295
- /// [`Event::FundingGenerationReady`]: events::Event::FundingGenerationReady
1296
+ /// [`Event::FundingGenerationReady::user_channel_id `]: events::Event::FundingGenerationReady::user_channel_id
1296
1297
/// [`Event::FundingGenerationReady::temporary_channel_id`]: events::Event::FundingGenerationReady::temporary_channel_id
1297
1298
/// [`Event::ChannelClosed::channel_id`]: events::Event::ChannelClosed::channel_id
1298
- pub fn create_channel ( & self , their_network_key : PublicKey , channel_value_satoshis : u64 , push_msat : u64 , user_id : u64 , override_config : Option < UserConfig > ) -> Result < [ u8 ; 32 ] , APIError > {
1299
+ pub fn create_channel ( & self , their_network_key : PublicKey , channel_value_satoshis : u64 , push_msat : u64 , user_channel_id : u64 , override_config : Option < UserConfig > ) -> Result < [ u8 ; 32 ] , APIError > {
1299
1300
if channel_value_satoshis < 1000 {
1300
1301
return Err ( APIError :: APIMisuseError { err : format ! ( "Channel value must be at least 1000 satoshis. It was {}" , channel_value_satoshis) } ) ;
1301
1302
}
@@ -1307,7 +1308,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
1307
1308
let peer_state = peer_state. lock ( ) . unwrap ( ) ;
1308
1309
let their_features = & peer_state. latest_features ;
1309
1310
let config = if override_config. is_some ( ) { override_config. as_ref ( ) . unwrap ( ) } else { & self . default_configuration } ;
1310
- Channel :: new_outbound ( & self . fee_estimator , & self . keys_manager , their_network_key, their_features, channel_value_satoshis, push_msat, user_id , config) ?
1311
+ Channel :: new_outbound ( & self . fee_estimator , & self . keys_manager , their_network_key, their_features, channel_value_satoshis, push_msat, user_channel_id , config) ?
1311
1312
} ,
1312
1313
None => return Err ( APIError :: ChannelUnavailable { err : format ! ( "Not connected to node: {}" , their_network_key) } ) ,
1313
1314
}
@@ -1360,7 +1361,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
1360
1361
unspendable_punishment_reserve : to_self_reserve_satoshis,
1361
1362
inbound_capacity_msat,
1362
1363
outbound_capacity_msat,
1363
- user_id : channel. get_user_id ( ) ,
1364
+ user_channel_id : channel. get_user_id ( ) ,
1364
1365
confirmations_required : channel. minimum_depth ( ) ,
1365
1366
force_close_spend_delay : channel. get_counterparty_selected_contest_delay ( ) ,
1366
1367
is_outbound : channel. is_outbound ( ) ,
0 commit comments