@@ -359,25 +359,11 @@ pub struct ChannelDetails {
359359 ///
360360 /// This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
361361 pub feerate_sat_per_1000_weight : Option < u32 > ,
362- /// Our total balance. This is the amount we would get if we close the channel.
363- /// This value is not exact. Due to various in-flight changes and feerate changes, exactly this
364- /// amount is not likely to be recoverable on close.
365- ///
366- /// This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
367- /// balance is not available for inclusion in new outbound HTLCs). This further does not include
368- /// any pending outgoing HTLCs which are awaiting some other resolution to be sent.
369- /// This does not consider any on-chain fees.
370- ///
371- /// See also [`ChannelDetails::outbound_capacity_msat`]
372- #[ deprecated( since = "0.0.124" , note = "use [`ChainMonitor::get_claimable_balances`] instead" ) ]
373- pub balance_msat : u64 ,
374362 /// The available outbound capacity for sending HTLCs to the remote peer. This does not include
375363 /// any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
376364 /// available for inclusion in new outbound HTLCs). This further does not include any pending
377365 /// outgoing HTLCs which are awaiting some other resolution to be sent.
378366 ///
379- /// See also [`ChannelDetails::balance_msat`]
380- ///
381367 /// This value is not exact. Due to various in-flight changes, feerate changes, and our
382368 /// conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
383369 /// should be able to spend nearly this amount.
@@ -387,8 +373,8 @@ pub struct ChannelDetails {
387373 /// the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
388374 /// to use a limit as close as possible to the HTLC limit we can currently send.
389375 ///
390- /// See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
391- /// [`ChannelDetails::balance_msat`], and [`ChannelDetails:: outbound_capacity_msat`].
376+ /// See also [`ChannelDetails::next_outbound_htlc_minimum_msat`] and
377+ /// [`ChannelDetails::outbound_capacity_msat`].
392378 pub next_outbound_htlc_limit_msat : u64 ,
393379 /// The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
394380 /// [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
@@ -540,7 +526,6 @@ impl ChannelDetails {
540526 channel_value_satoshis : context. get_value_satoshis ( ) ,
541527 feerate_sat_per_1000_weight : Some ( context. get_feerate_sat_per_1000_weight ( ) ) ,
542528 unspendable_punishment_reserve : to_self_reserve_satoshis,
543- balance_msat : balance. balance_msat ,
544529 inbound_capacity_msat : balance. inbound_capacity_msat ,
545530 outbound_capacity_msat : balance. outbound_capacity_msat ,
546531 next_outbound_htlc_limit_msat : balance. next_outbound_htlc_limit_msat ,
@@ -584,7 +569,7 @@ impl Writeable for ChannelDetails {
584569 ( 10 , self . channel_value_satoshis, required) ,
585570 ( 12 , self . unspendable_punishment_reserve, option) ,
586571 ( 14 , user_channel_id_low, required) ,
587- ( 16 , self . balance_msat , required) ,
572+ ( 16 , self . next_outbound_htlc_limit_msat , required) , // Forwards compatibility for removed balance_msat field.
588573 ( 18 , self . outbound_capacity_msat, required) ,
589574 ( 19 , self . next_outbound_htlc_limit_msat, required) ,
590575 ( 20 , self . inbound_capacity_msat, required) ,
@@ -623,7 +608,7 @@ impl Readable for ChannelDetails {
623608 ( 10 , channel_value_satoshis, required) ,
624609 ( 12 , unspendable_punishment_reserve, option) ,
625610 ( 14 , user_channel_id_low, required) ,
626- ( 16 , balance_msat , required ) ,
611+ ( 16 , _balance_msat , option ) , // Backwards compatibility for removed balance_msat field.
627612 ( 18 , outbound_capacity_msat, required) ,
628613 // Note that by the time we get past the required read above, outbound_capacity_msat will be
629614 // filled in, so we can safely unwrap it here.
@@ -651,7 +636,8 @@ impl Readable for ChannelDetails {
651636 let user_channel_id = user_channel_id_low as u128
652637 + ( ( user_channel_id_high_opt. unwrap_or ( 0 as u64 ) as u128 ) << 64 ) ;
653638
654- #[ allow( deprecated) ] // TODO: Remove once balance_msat is removed.
639+ let _balance_msat: Option < u64 > = _balance_msat;
640+
655641 Ok ( Self {
656642 inbound_scid_alias,
657643 channel_id : channel_id. 0 . unwrap ( ) ,
@@ -664,7 +650,6 @@ impl Readable for ChannelDetails {
664650 channel_value_satoshis : channel_value_satoshis. 0 . unwrap ( ) ,
665651 unspendable_punishment_reserve,
666652 user_channel_id,
667- balance_msat : balance_msat. 0 . unwrap ( ) ,
668653 outbound_capacity_msat : outbound_capacity_msat. 0 . unwrap ( ) ,
669654 next_outbound_htlc_limit_msat : next_outbound_htlc_limit_msat. 0 . unwrap ( ) ,
670655 next_outbound_htlc_minimum_msat : next_outbound_htlc_minimum_msat. 0 . unwrap ( ) ,
@@ -762,7 +747,6 @@ mod tests {
762747 inbound_scid_alias : None ,
763748 channel_value_satoshis : 50_100 ,
764749 user_channel_id : ( u64:: MAX as u128 ) + 1 , // Gets us into the high bytes
765- balance_msat : 23_100 ,
766750 outbound_capacity_msat : 24_300 ,
767751 next_outbound_htlc_limit_msat : 20_000 ,
768752 next_outbound_htlc_minimum_msat : 132 ,
0 commit comments