@@ -1272,11 +1272,12 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
12721272
12731273 /// Creates a new outbound channel to the given remote node and with the given value.
12741274 ///
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.
12801281 ///
12811282 /// Raises [`APIError::APIMisuseError`] when `channel_value_satoshis` > 2**24 or `push_msat` is
12821283 /// 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
12921293 /// one derived from the funding transaction's TXID. If the counterparty rejects the channel
12931294 /// immediately, this temporary ID will appear in [`Event::ChannelClosed::channel_id`].
12941295 ///
1295- /// [`Event::FundingGenerationReady`]: events::Event::FundingGenerationReady
1296+ /// [`Event::FundingGenerationReady::user_channel_id `]: events::Event::FundingGenerationReady::user_channel_id
12961297 /// [`Event::FundingGenerationReady::temporary_channel_id`]: events::Event::FundingGenerationReady::temporary_channel_id
12971298 /// [`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 > {
12991300 if channel_value_satoshis < 1000 {
13001301 return Err ( APIError :: APIMisuseError { err : format ! ( "Channel value must be at least 1000 satoshis. It was {}" , channel_value_satoshis) } ) ;
13011302 }
@@ -1307,7 +1308,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
13071308 let peer_state = peer_state. lock ( ) . unwrap ( ) ;
13081309 let their_features = & peer_state. latest_features ;
13091310 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) ?
13111312 } ,
13121313 None => return Err ( APIError :: ChannelUnavailable { err : format ! ( "Not connected to node: {}" , their_network_key) } ) ,
13131314 }
0 commit comments