@@ -1407,24 +1407,11 @@ pub struct ChannelDetails {
14071407 ///
14081408 /// This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
14091409 pub feerate_sat_per_1000_weight : Option < u32 > ,
1410- /// Our total balance. This is the amount we would get if we close the channel.
1411- /// This value is not exact. Due to various in-flight changes and feerate changes, exactly this
1412- /// amount is not likely to be recoverable on close.
1413- ///
1414- /// This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
1415- /// balance is not available for inclusion in new outbound HTLCs). This further does not include
1416- /// any pending outgoing HTLCs which are awaiting some other resolution to be sent.
1417- /// This does not consider any on-chain fees.
1418- ///
1419- /// See also [`ChannelDetails::outbound_capacity_msat`]
1420- pub balance_msat : u64 ,
14211410 /// The available outbound capacity for sending HTLCs to the remote peer. This does not include
14221411 /// any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
14231412 /// available for inclusion in new outbound HTLCs). This further does not include any pending
14241413 /// outgoing HTLCs which are awaiting some other resolution to be sent.
14251414 ///
1426- /// See also [`ChannelDetails::balance_msat`]
1427- ///
14281415 /// This value is not exact. Due to various in-flight changes, feerate changes, and our
14291416 /// conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
14301417 /// should be able to spend nearly this amount.
@@ -1434,8 +1421,8 @@ pub struct ChannelDetails {
14341421 /// the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
14351422 /// to use a limit as close as possible to the HTLC limit we can currently send.
14361423 ///
1437- /// See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
1438- /// [`ChannelDetails::balance_msat`], and [`ChannelDetails:: outbound_capacity_msat`].
1424+ /// See also [`ChannelDetails::next_outbound_htlc_minimum_msat`] and
1425+ /// [`ChannelDetails::outbound_capacity_msat`].
14391426 pub next_outbound_htlc_limit_msat : u64 ,
14401427 /// The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
14411428 /// [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
@@ -1563,7 +1550,6 @@ impl ChannelDetails {
15631550 channel_value_satoshis : context. get_value_satoshis ( ) ,
15641551 feerate_sat_per_1000_weight : Some ( context. get_feerate_sat_per_1000_weight ( ) ) ,
15651552 unspendable_punishment_reserve : to_self_reserve_satoshis,
1566- balance_msat : balance. balance_msat ,
15671553 inbound_capacity_msat : balance. inbound_capacity_msat ,
15681554 outbound_capacity_msat : balance. outbound_capacity_msat ,
15691555 next_outbound_htlc_limit_msat : balance. next_outbound_htlc_limit_msat ,
@@ -7514,7 +7500,7 @@ impl Writeable for ChannelDetails {
75147500 ( 10 , self . channel_value_satoshis, required) ,
75157501 ( 12 , self . unspendable_punishment_reserve, option) ,
75167502 ( 14 , user_channel_id_low, required) ,
7517- ( 16 , self . balance_msat , required) ,
7503+ ( 16 , 0 as u64 , required) , // Forwards compatibility for removed balance_msat field.
75187504 ( 18 , self . outbound_capacity_msat, required) ,
75197505 ( 19 , self . next_outbound_htlc_limit_msat, required) ,
75207506 ( 20 , self . inbound_capacity_msat, required) ,
@@ -7550,7 +7536,7 @@ impl Readable for ChannelDetails {
75507536 ( 10 , channel_value_satoshis, required) ,
75517537 ( 12 , unspendable_punishment_reserve, option) ,
75527538 ( 14 , user_channel_id_low, required) ,
7553- ( 16 , balance_msat , required) ,
7539+ ( 16 , _balance_msat , required) , // Backwards compatibility for removed balance_msat field.
75547540 ( 18 , outbound_capacity_msat, required) ,
75557541 // Note that by the time we get past the required read above, outbound_capacity_msat will be
75567542 // filled in, so we can safely unwrap it here.
@@ -7576,6 +7562,8 @@ impl Readable for ChannelDetails {
75767562 let user_channel_id = user_channel_id_low as u128 +
75777563 ( ( user_channel_id_high_opt. unwrap_or ( 0 as u64 ) as u128 ) << 64 ) ;
75787564
7565+ let _balance_msat: u64 = _balance_msat. 0 . unwrap ( ) ;
7566+
75797567 Ok ( Self {
75807568 inbound_scid_alias,
75817569 channel_id : channel_id. 0 . unwrap ( ) ,
@@ -7588,7 +7576,6 @@ impl Readable for ChannelDetails {
75887576 channel_value_satoshis : channel_value_satoshis. 0 . unwrap ( ) ,
75897577 unspendable_punishment_reserve,
75907578 user_channel_id,
7591- balance_msat : balance_msat. 0 . unwrap ( ) ,
75927579 outbound_capacity_msat : outbound_capacity_msat. 0 . unwrap ( ) ,
75937580 next_outbound_htlc_limit_msat : next_outbound_htlc_limit_msat. 0 . unwrap ( ) ,
75947581 next_outbound_htlc_minimum_msat : next_outbound_htlc_minimum_msat. 0 . unwrap ( ) ,
0 commit comments