@@ -1274,8 +1274,14 @@ pub struct ChannelDetails {
12741274 /// the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
12751275 /// to use a limit as close as possible to the HTLC limit we can currently send.
12761276 ///
1277- /// See also [`ChannelDetails::balance_msat`] and [`ChannelDetails::outbound_capacity_msat`].
1277+ /// See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
1278+ /// [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
12781279 pub next_outbound_htlc_limit_msat : u64 ,
1280+ /// The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
1281+ /// [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
1282+ /// an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
1283+ /// route which is valid.
1284+ pub next_outbound_htlc_minimum_msat : u64 ,
12791285 /// The available inbound capacity for the remote peer to send HTLCs to us. This does not
12801286 /// include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
12811287 /// available for inclusion in new inbound HTLCs).
@@ -1395,6 +1401,7 @@ impl ChannelDetails {
13951401 inbound_capacity_msat : balance. inbound_capacity_msat ,
13961402 outbound_capacity_msat : balance. outbound_capacity_msat ,
13971403 next_outbound_htlc_limit_msat : balance. next_outbound_htlc_limit_msat ,
1404+ next_outbound_htlc_minimum_msat : balance. next_outbound_htlc_minimum_msat ,
13981405 user_channel_id : channel. get_user_id ( ) ,
13991406 confirmations_required : channel. minimum_depth ( ) ,
14001407 confirmations : Some ( channel. get_funding_tx_confirmations ( best_block_height) ) ,
@@ -6951,10 +6958,9 @@ impl Writeable for ChannelDetails {
69516958 ( 14 , user_channel_id_low, required) ,
69526959 ( 16 , self . balance_msat, required) ,
69536960 ( 18 , self . outbound_capacity_msat, required) ,
6954- // Note that by the time we get past the required read above, outbound_capacity_msat will be
6955- // filled in, so we can safely unwrap it here.
6956- ( 19 , self . next_outbound_htlc_limit_msat, ( default_value, outbound_capacity_msat. 0 . unwrap( ) as u64 ) ) ,
6961+ ( 19 , self . next_outbound_htlc_limit_msat, required) ,
69576962 ( 20 , self . inbound_capacity_msat, required) ,
6963+ ( 21 , self . next_outbound_htlc_minimum_msat, required) ,
69586964 ( 22 , self . confirmations_required, option) ,
69596965 ( 24 , self . force_close_spend_delay, option) ,
69606966 ( 26 , self . is_outbound, required) ,
@@ -6991,6 +6997,7 @@ impl Readable for ChannelDetails {
69916997 // filled in, so we can safely unwrap it here.
69926998 ( 19 , next_outbound_htlc_limit_msat, ( default_value, outbound_capacity_msat. 0 . unwrap( ) as u64 ) ) ,
69936999 ( 20 , inbound_capacity_msat, required) ,
7000+ ( 21 , next_outbound_htlc_minimum_msat, ( default_value, 0 ) ) ,
69947001 ( 22 , confirmations_required, option) ,
69957002 ( 24 , force_close_spend_delay, option) ,
69967003 ( 26 , is_outbound, required) ,
@@ -7024,6 +7031,7 @@ impl Readable for ChannelDetails {
70247031 balance_msat : balance_msat. 0 . unwrap ( ) ,
70257032 outbound_capacity_msat : outbound_capacity_msat. 0 . unwrap ( ) ,
70267033 next_outbound_htlc_limit_msat : next_outbound_htlc_limit_msat. 0 . unwrap ( ) ,
7034+ next_outbound_htlc_minimum_msat : next_outbound_htlc_minimum_msat. 0 . unwrap ( ) ,
70277035 inbound_capacity_msat : inbound_capacity_msat. 0 . unwrap ( ) ,
70287036 confirmations_required,
70297037 confirmations,
0 commit comments