@@ -680,12 +680,22 @@ impl<ChanSigner: ChannelKeys, M: Deref, T: Deref> ChannelManager<ChanSigner, M,
680
680
///
681
681
/// Raises APIError::APIMisuseError when channel_value_satoshis > 2**24 or push_msat is
682
682
/// greater than channel_value_satoshis * 1k or channel_value_satoshis is < 1000.
683
- pub fn create_channel ( & self , their_network_key : PublicKey , channel_value_satoshis : u64 , push_msat : u64 , user_id : u64 ) -> Result < ( ) , APIError > {
683
+ pub fn create_channel ( & self , their_network_key : PublicKey , channel_value_satoshis : u64 , push_msat : u64 , user_id : u64 , override_config : Option < UserConfig > ) -> Result < ( ) , APIError > {
684
684
if channel_value_satoshis < 1000 {
685
685
return Err ( APIError :: APIMisuseError { err : "channel_value must be at least 1000 satoshis" } ) ;
686
686
}
687
687
688
- let channel = Channel :: new_outbound ( & * self . fee_estimator , & self . keys_manager , their_network_key, channel_value_satoshis, push_msat, user_id, Arc :: clone ( & self . logger ) , & self . default_configuration ) ?;
688
+ let channel = match override_config {
689
+ Some ( config) => {
690
+ Channel :: new_outbound ( & * self . fee_estimator , & self . keys_manager , their_network_key, channel_value_satoshis, push_msat, user_id,
691
+ Arc :: clone ( & self . logger ) , & config) ?
692
+ } ,
693
+ None => {
694
+ Channel :: new_outbound ( & * self . fee_estimator , & self . keys_manager , their_network_key, channel_value_satoshis, push_msat, user_id,
695
+ Arc :: clone ( & self . logger ) , & self . default_configuration ) ?
696
+ }
697
+ } ;
698
+
689
699
let res = channel. get_open_channel ( self . genesis_hash . clone ( ) , & * self . fee_estimator ) ;
690
700
691
701
let _ = self . total_consistency_lock . read ( ) . unwrap ( ) ;
0 commit comments