@@ -1407,24 +1407,11 @@ pub struct ChannelDetails {
1407
1407
///
1408
1408
/// This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
1409
1409
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 ,
1421
1410
/// The available outbound capacity for sending HTLCs to the remote peer. This does not include
1422
1411
/// any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
1423
1412
/// available for inclusion in new outbound HTLCs). This further does not include any pending
1424
1413
/// outgoing HTLCs which are awaiting some other resolution to be sent.
1425
1414
///
1426
- /// See also [`ChannelDetails::balance_msat`]
1427
- ///
1428
1415
/// This value is not exact. Due to various in-flight changes, feerate changes, and our
1429
1416
/// conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
1430
1417
/// should be able to spend nearly this amount.
@@ -1434,8 +1421,8 @@ pub struct ChannelDetails {
1434
1421
/// the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
1435
1422
/// to use a limit as close as possible to the HTLC limit we can currently send.
1436
1423
///
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`].
1439
1426
pub next_outbound_htlc_limit_msat : u64 ,
1440
1427
/// The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
1441
1428
/// [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
@@ -1563,7 +1550,6 @@ impl ChannelDetails {
1563
1550
channel_value_satoshis : context. get_value_satoshis ( ) ,
1564
1551
feerate_sat_per_1000_weight : Some ( context. get_feerate_sat_per_1000_weight ( ) ) ,
1565
1552
unspendable_punishment_reserve : to_self_reserve_satoshis,
1566
- balance_msat : balance. balance_msat ,
1567
1553
inbound_capacity_msat : balance. inbound_capacity_msat ,
1568
1554
outbound_capacity_msat : balance. outbound_capacity_msat ,
1569
1555
next_outbound_htlc_limit_msat : balance. next_outbound_htlc_limit_msat ,
@@ -7514,7 +7500,7 @@ impl Writeable for ChannelDetails {
7514
7500
( 10 , self . channel_value_satoshis, required) ,
7515
7501
( 12 , self . unspendable_punishment_reserve, option) ,
7516
7502
( 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.
7518
7504
( 18 , self . outbound_capacity_msat, required) ,
7519
7505
( 19 , self . next_outbound_htlc_limit_msat, required) ,
7520
7506
( 20 , self . inbound_capacity_msat, required) ,
@@ -7550,7 +7536,7 @@ impl Readable for ChannelDetails {
7550
7536
( 10 , channel_value_satoshis, required) ,
7551
7537
( 12 , unspendable_punishment_reserve, option) ,
7552
7538
( 14 , user_channel_id_low, required) ,
7553
- ( 16 , balance_msat , required) ,
7539
+ ( 16 , _balance_msat , required) , // Backwards compatibility for removed balance_msat field.
7554
7540
( 18 , outbound_capacity_msat, required) ,
7555
7541
// Note that by the time we get past the required read above, outbound_capacity_msat will be
7556
7542
// filled in, so we can safely unwrap it here.
@@ -7576,6 +7562,8 @@ impl Readable for ChannelDetails {
7576
7562
let user_channel_id = user_channel_id_low as u128 +
7577
7563
( ( user_channel_id_high_opt. unwrap_or ( 0 as u64 ) as u128 ) << 64 ) ;
7578
7564
7565
+ let _balance_msat: u64 = _balance_msat. 0 . unwrap ( ) ;
7566
+
7579
7567
Ok ( Self {
7580
7568
inbound_scid_alias,
7581
7569
channel_id : channel_id. 0 . unwrap ( ) ,
@@ -7588,7 +7576,6 @@ impl Readable for ChannelDetails {
7588
7576
channel_value_satoshis : channel_value_satoshis. 0 . unwrap ( ) ,
7589
7577
unspendable_punishment_reserve,
7590
7578
user_channel_id,
7591
- balance_msat : balance_msat. 0 . unwrap ( ) ,
7592
7579
outbound_capacity_msat : outbound_capacity_msat. 0 . unwrap ( ) ,
7593
7580
next_outbound_htlc_limit_msat : next_outbound_htlc_limit_msat. 0 . unwrap ( ) ,
7594
7581
next_outbound_htlc_minimum_msat : next_outbound_htlc_minimum_msat. 0 . unwrap ( ) ,
0 commit comments