@@ -359,25 +359,11 @@ pub struct ChannelDetails {
359
359
///
360
360
/// This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
361
361
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 ,
374
362
/// The available outbound capacity for sending HTLCs to the remote peer. This does not include
375
363
/// any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
376
364
/// available for inclusion in new outbound HTLCs). This further does not include any pending
377
365
/// outgoing HTLCs which are awaiting some other resolution to be sent.
378
366
///
379
- /// See also [`ChannelDetails::balance_msat`]
380
- ///
381
367
/// This value is not exact. Due to various in-flight changes, feerate changes, and our
382
368
/// conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
383
369
/// should be able to spend nearly this amount.
@@ -387,8 +373,8 @@ pub struct ChannelDetails {
387
373
/// the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
388
374
/// to use a limit as close as possible to the HTLC limit we can currently send.
389
375
///
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`].
392
378
pub next_outbound_htlc_limit_msat : u64 ,
393
379
/// The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
394
380
/// [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
@@ -540,7 +526,6 @@ impl ChannelDetails {
540
526
channel_value_satoshis : context. get_value_satoshis ( ) ,
541
527
feerate_sat_per_1000_weight : Some ( context. get_feerate_sat_per_1000_weight ( ) ) ,
542
528
unspendable_punishment_reserve : to_self_reserve_satoshis,
543
- balance_msat : balance. balance_msat ,
544
529
inbound_capacity_msat : balance. inbound_capacity_msat ,
545
530
outbound_capacity_msat : balance. outbound_capacity_msat ,
546
531
next_outbound_htlc_limit_msat : balance. next_outbound_htlc_limit_msat ,
@@ -584,7 +569,7 @@ impl Writeable for ChannelDetails {
584
569
( 10 , self . channel_value_satoshis, required) ,
585
570
( 12 , self . unspendable_punishment_reserve, option) ,
586
571
( 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.
588
573
( 18 , self . outbound_capacity_msat, required) ,
589
574
( 19 , self . next_outbound_htlc_limit_msat, required) ,
590
575
( 20 , self . inbound_capacity_msat, required) ,
@@ -623,7 +608,7 @@ impl Readable for ChannelDetails {
623
608
( 10 , channel_value_satoshis, required) ,
624
609
( 12 , unspendable_punishment_reserve, option) ,
625
610
( 14 , user_channel_id_low, required) ,
626
- ( 16 , balance_msat , required ) ,
611
+ ( 16 , _balance_msat , option ) , // Backwards compatibility for removed balance_msat field.
627
612
( 18 , outbound_capacity_msat, required) ,
628
613
// Note that by the time we get past the required read above, outbound_capacity_msat will be
629
614
// filled in, so we can safely unwrap it here.
@@ -651,7 +636,8 @@ impl Readable for ChannelDetails {
651
636
let user_channel_id = user_channel_id_low as u128
652
637
+ ( ( user_channel_id_high_opt. unwrap_or ( 0 as u64 ) as u128 ) << 64 ) ;
653
638
654
- #[ allow( deprecated) ] // TODO: Remove once balance_msat is removed.
639
+ let _balance_msat: Option < u64 > = _balance_msat;
640
+
655
641
Ok ( Self {
656
642
inbound_scid_alias,
657
643
channel_id : channel_id. 0 . unwrap ( ) ,
@@ -664,7 +650,6 @@ impl Readable for ChannelDetails {
664
650
channel_value_satoshis : channel_value_satoshis. 0 . unwrap ( ) ,
665
651
unspendable_punishment_reserve,
666
652
user_channel_id,
667
- balance_msat : balance_msat. 0 . unwrap ( ) ,
668
653
outbound_capacity_msat : outbound_capacity_msat. 0 . unwrap ( ) ,
669
654
next_outbound_htlc_limit_msat : next_outbound_htlc_limit_msat. 0 . unwrap ( ) ,
670
655
next_outbound_htlc_minimum_msat : next_outbound_htlc_minimum_msat. 0 . unwrap ( ) ,
@@ -762,7 +747,6 @@ mod tests {
762
747
inbound_scid_alias : None ,
763
748
channel_value_satoshis : 50_100 ,
764
749
user_channel_id : ( u64:: MAX as u128 ) + 1 , // Gets us into the high bytes
765
- balance_msat : 23_100 ,
766
750
outbound_capacity_msat : 24_300 ,
767
751
next_outbound_htlc_limit_msat : 20_000 ,
768
752
next_outbound_htlc_minimum_msat : 132 ,
0 commit comments