@@ -1332,6 +1332,12 @@ pub struct ChannelCounterparty {
1332
1332
}
1333
1333
1334
1334
/// Details of a channel, as returned by [`ChannelManager::list_channels`] and [`ChannelManager::list_usable_channels`]
1335
+ ///
1336
+ /// Balances of a channel are available through [`ChainMonitor::get_claimable_balances`] and
1337
+ /// [`ChannelMonitor::get_claimable_balances`], calculated with respect to the corresponding on-chain
1338
+ /// transactions.
1339
+ ///
1340
+ /// [`ChainMonitor::get_claimable_balances`]: crate::chain::chainmonitor::ChainMonitor::get_claimable_balances
1335
1341
#[ derive( Clone , Debug , PartialEq ) ]
1336
1342
pub struct ChannelDetails {
1337
1343
/// The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
@@ -1407,24 +1413,11 @@ pub struct ChannelDetails {
1407
1413
///
1408
1414
/// This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
1409
1415
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
1416
/// The available outbound capacity for sending HTLCs to the remote peer. This does not include
1422
1417
/// any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
1423
1418
/// available for inclusion in new outbound HTLCs). This further does not include any pending
1424
1419
/// outgoing HTLCs which are awaiting some other resolution to be sent.
1425
1420
///
1426
- /// See also [`ChannelDetails::balance_msat`]
1427
- ///
1428
1421
/// This value is not exact. Due to various in-flight changes, feerate changes, and our
1429
1422
/// conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
1430
1423
/// should be able to spend nearly this amount.
@@ -1434,8 +1427,8 @@ pub struct ChannelDetails {
1434
1427
/// the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
1435
1428
/// to use a limit as close as possible to the HTLC limit we can currently send.
1436
1429
///
1437
- /// See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
1438
- /// [`ChannelDetails::balance_msat`], and [`ChannelDetails:: outbound_capacity_msat`].
1430
+ /// See also [`ChannelDetails::next_outbound_htlc_minimum_msat`] and
1431
+ /// [`ChannelDetails::outbound_capacity_msat`].
1439
1432
pub next_outbound_htlc_limit_msat : u64 ,
1440
1433
/// The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
1441
1434
/// [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
@@ -1563,7 +1556,6 @@ impl ChannelDetails {
1563
1556
channel_value_satoshis : context. get_value_satoshis ( ) ,
1564
1557
feerate_sat_per_1000_weight : Some ( context. get_feerate_sat_per_1000_weight ( ) ) ,
1565
1558
unspendable_punishment_reserve : to_self_reserve_satoshis,
1566
- balance_msat : balance. balance_msat ,
1567
1559
inbound_capacity_msat : balance. inbound_capacity_msat ,
1568
1560
outbound_capacity_msat : balance. outbound_capacity_msat ,
1569
1561
next_outbound_htlc_limit_msat : balance. next_outbound_htlc_limit_msat ,
@@ -7514,7 +7506,7 @@ impl Writeable for ChannelDetails {
7514
7506
( 10 , self . channel_value_satoshis, required) ,
7515
7507
( 12 , self . unspendable_punishment_reserve, option) ,
7516
7508
( 14 , user_channel_id_low, required) ,
7517
- ( 16 , self . balance_msat , required) ,
7509
+ ( 16 , self . next_outbound_htlc_limit_msat , required) , // Forwards compatibility for removed balance_msat field.
7518
7510
( 18 , self . outbound_capacity_msat, required) ,
7519
7511
( 19 , self . next_outbound_htlc_limit_msat, required) ,
7520
7512
( 20 , self . inbound_capacity_msat, required) ,
@@ -7550,7 +7542,7 @@ impl Readable for ChannelDetails {
7550
7542
( 10 , channel_value_satoshis, required) ,
7551
7543
( 12 , unspendable_punishment_reserve, option) ,
7552
7544
( 14 , user_channel_id_low, required) ,
7553
- ( 16 , balance_msat , required ) ,
7545
+ ( 16 , _balance_msat , option ) , // Backwards compatibility for removed balance_msat field.
7554
7546
( 18 , outbound_capacity_msat, required) ,
7555
7547
// Note that by the time we get past the required read above, outbound_capacity_msat will be
7556
7548
// filled in, so we can safely unwrap it here.
@@ -7588,7 +7580,6 @@ impl Readable for ChannelDetails {
7588
7580
channel_value_satoshis : channel_value_satoshis. 0 . unwrap ( ) ,
7589
7581
unspendable_punishment_reserve,
7590
7582
user_channel_id,
7591
- balance_msat : balance_msat. 0 . unwrap ( ) ,
7592
7583
outbound_capacity_msat : outbound_capacity_msat. 0 . unwrap ( ) ,
7593
7584
next_outbound_htlc_limit_msat : next_outbound_htlc_limit_msat. 0 . unwrap ( ) ,
7594
7585
next_outbound_htlc_minimum_msat : next_outbound_htlc_minimum_msat. 0 . unwrap ( ) ,
0 commit comments