@@ -1332,6 +1332,10 @@ pub struct ChannelCounterparty {
13321332}
13331333
13341334/// 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.
13351339#[ derive( Clone , Debug , PartialEq ) ]
13361340pub struct ChannelDetails {
13371341 /// The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
@@ -1407,24 +1411,11 @@ pub struct ChannelDetails {
14071411 ///
14081412 /// This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
14091413 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 ,
14211414 /// The available outbound capacity for sending HTLCs to the remote peer. This does not include
14221415 /// any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
14231416 /// available for inclusion in new outbound HTLCs). This further does not include any pending
14241417 /// outgoing HTLCs which are awaiting some other resolution to be sent.
14251418 ///
1426- /// See also [`ChannelDetails::balance_msat`]
1427- ///
14281419 /// This value is not exact. Due to various in-flight changes, feerate changes, and our
14291420 /// conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
14301421 /// should be able to spend nearly this amount.
@@ -1434,8 +1425,8 @@ pub struct ChannelDetails {
14341425 /// the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
14351426 /// to use a limit as close as possible to the HTLC limit we can currently send.
14361427 ///
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`].
14391430 pub next_outbound_htlc_limit_msat : u64 ,
14401431 /// The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
14411432 /// [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
@@ -1563,7 +1554,6 @@ impl ChannelDetails {
15631554 channel_value_satoshis : context. get_value_satoshis ( ) ,
15641555 feerate_sat_per_1000_weight : Some ( context. get_feerate_sat_per_1000_weight ( ) ) ,
15651556 unspendable_punishment_reserve : to_self_reserve_satoshis,
1566- balance_msat : balance. balance_msat ,
15671557 inbound_capacity_msat : balance. inbound_capacity_msat ,
15681558 outbound_capacity_msat : balance. outbound_capacity_msat ,
15691559 next_outbound_htlc_limit_msat : balance. next_outbound_htlc_limit_msat ,
@@ -7514,7 +7504,7 @@ impl Writeable for ChannelDetails {
75147504 ( 10 , self . channel_value_satoshis, required) ,
75157505 ( 12 , self . unspendable_punishment_reserve, option) ,
75167506 ( 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.
75187508 ( 18 , self . outbound_capacity_msat, required) ,
75197509 ( 19 , self . next_outbound_htlc_limit_msat, required) ,
75207510 ( 20 , self . inbound_capacity_msat, required) ,
@@ -7550,7 +7540,7 @@ impl Readable for ChannelDetails {
75507540 ( 10 , channel_value_satoshis, required) ,
75517541 ( 12 , unspendable_punishment_reserve, option) ,
75527542 ( 14 , user_channel_id_low, required) ,
7553- ( 16 , balance_msat , required ) ,
7543+ ( 16 , _balance_msat , option ) , // Backwards compatibility for removed balance_msat field.
75547544 ( 18 , outbound_capacity_msat, required) ,
75557545 // Note that by the time we get past the required read above, outbound_capacity_msat will be
75567546 // filled in, so we can safely unwrap it here.
@@ -7588,7 +7578,6 @@ impl Readable for ChannelDetails {
75887578 channel_value_satoshis : channel_value_satoshis. 0 . unwrap ( ) ,
75897579 unspendable_punishment_reserve,
75907580 user_channel_id,
7591- balance_msat : balance_msat. 0 . unwrap ( ) ,
75927581 outbound_capacity_msat : outbound_capacity_msat. 0 . unwrap ( ) ,
75937582 next_outbound_htlc_limit_msat : next_outbound_htlc_limit_msat. 0 . unwrap ( ) ,
75947583 next_outbound_htlc_minimum_msat : next_outbound_htlc_minimum_msat. 0 . unwrap ( ) ,
0 commit comments