@@ -123,7 +123,7 @@ pub use builder::BuildError;
123123pub use builder:: NodeBuilder as Builder ;
124124
125125use config:: {
126- NODE_ANN_BCAST_INTERVAL , PEER_RECONNECTION_INTERVAL ,
126+ default_user_config , NODE_ANN_BCAST_INTERVAL , PEER_RECONNECTION_INTERVAL ,
127127 RESOLVED_CHANNEL_MONITOR_ARCHIVAL_INTERVAL , RGS_SYNC_INTERVAL ,
128128 WALLET_SYNC_INTERVAL_MINIMUM_SECS ,
129129} ;
@@ -148,7 +148,6 @@ use lightning::events::bump_transaction::Wallet as LdkWallet;
148148use lightning:: ln:: channelmanager:: { ChannelShutdownState , PaymentId } ;
149149use lightning:: ln:: msgs:: SocketAddress ;
150150
151- use lightning:: util:: config:: { ChannelHandshakeConfig , UserConfig } ;
152151pub use lightning:: util:: logger:: Level as LogLevel ;
153152
154153use lightning_background_processor:: process_events_async;
@@ -1087,17 +1086,17 @@ impl Node {
10871086 return Err ( Error :: InsufficientFunds ) ;
10881087 }
10891088
1090- let channel_config = ( * ( channel_config . unwrap_or_default ( ) ) ) . clone ( ) . into ( ) ;
1091- let user_config = UserConfig {
1092- channel_handshake_limits : Default :: default ( ) ,
1093- channel_handshake_config : ChannelHandshakeConfig {
1094- announced_channel : announce_channel ,
1095- negotiate_anchors_zero_fee_htlc_tx : self . config . anchor_channels_config . is_some ( ) ,
1096- .. Default :: default ( )
1097- } ,
1098- channel_config ,
1099- .. Default :: default ( )
1100- } ;
1089+ let mut user_config = default_user_config ( & self . config ) ;
1090+ user_config. channel_handshake_config . announced_channel = announce_channel ;
1091+ user_config . channel_config = ( * ( channel_config . unwrap_or_default ( ) ) ) . clone ( ) . into ( ) ;
1092+ // We set the max inflight to 100% for private channels.
1093+ // FIXME: LDK will default to this behavior soon, too, at which point we should drop this
1094+ // manual override.
1095+ if !announce_channel {
1096+ user_config
1097+ . channel_handshake_config
1098+ . max_inbound_htlc_value_in_flight_percent_of_channel = 100 ;
1099+ }
11011100
11021101 let push_msat = push_to_counterparty_msat. unwrap_or ( 0 ) ;
11031102 let user_channel_id: u128 = rand:: thread_rng ( ) . gen :: < u128 > ( ) ;
0 commit comments