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