Skip to content

Commit

Permalink
Drop balance_msat from ChannelDetails
Browse files Browse the repository at this point in the history
This was discussed upstream but reverted for now. The field is very
confusing and misleading, and we can finally drop it now that we have a
better `list_balances` interface.
  • Loading branch information
tnull committed Feb 23, 2024
1 parent 0b901fc commit e809b23
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
1 change: 0 additions & 1 deletion bindings/ldk_node.udl
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ dictionary ChannelDetails {
u64? unspendable_punishment_reserve;
UserChannelId user_channel_id;
u32 feerate_sat_per_1000_weight;
u64 balance_msat;
u64 outbound_capacity_msat;
u64 inbound_capacity_msat;
u32? confirmations_required;
Expand Down
11 changes: 2 additions & 9 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,6 @@ pub struct ChannelDetails {
/// The currently negotiated fee rate denominated in satoshi per 1000 weight units,
/// which is applied to commitment and HTLC transactions.
pub feerate_sat_per_1000_weight: u32,
/// The total balance of the channel. This is the amount that will be returned to
/// the user if the channel is closed.
///
/// The value is not exact, due to potential in-flight and fee-rate changes. Therefore, exactly
/// this amount is likely irrecoverable on close.
pub balance_msat: u64,
/// The available outbound capacity for sending HTLCs to the remote peer.
///
/// The amount does not include any pending HTLCs which are not yet resolved (and, thus, whose
Expand Down Expand Up @@ -270,8 +264,8 @@ pub struct ChannelDetails {
/// the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
/// to use a limit as close as possible to the HTLC limit we can currently send.
///
/// See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
/// [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
/// See also [`ChannelDetails::next_outbound_htlc_minimum_msat`] and
/// [`ChannelDetails::outbound_capacity_msat`].
pub next_outbound_htlc_limit_msat: u64,
/// The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
/// [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
Expand Down Expand Up @@ -306,7 +300,6 @@ impl From<LdkChannelDetails> for ChannelDetails {
// unwrap safety: This value will be `None` for objects serialized with LDK versions
// prior to 0.0.115.
feerate_sat_per_1000_weight: value.feerate_sat_per_1000_weight.unwrap(),
balance_msat: value.balance_msat,
outbound_capacity_msat: value.outbound_capacity_msat,
inbound_capacity_msat: value.inbound_capacity_msat,
confirmations_required: value.confirmations_required,
Expand Down

0 comments on commit e809b23

Please sign in to comment.