Skip to content

Commit 7d88944

Browse files
committed
Drop balance_msat from ChannelDetails
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.
1 parent eb7c5dd commit 7d88944

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

bindings/ldk_node.udl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ dictionary ChannelDetails {
209209
u64? unspendable_punishment_reserve;
210210
UserChannelId user_channel_id;
211211
u32 feerate_sat_per_1000_weight;
212-
u64 balance_msat;
213212
u64 outbound_capacity_msat;
214213
u64 inbound_capacity_msat;
215214
u32? confirmations_required;

src/types.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,6 @@ pub struct ChannelDetails {
200200
/// The currently negotiated fee rate denominated in satoshi per 1000 weight units,
201201
/// which is applied to commitment and HTLC transactions.
202202
pub feerate_sat_per_1000_weight: u32,
203-
/// The total balance of the channel. This is the amount that will be returned to
204-
/// the user if the channel is closed.
205-
///
206-
/// The value is not exact, due to potential in-flight and fee-rate changes. Therefore, exactly
207-
/// this amount is likely irrecoverable on close.
208-
pub balance_msat: u64,
209203
/// The available outbound capacity for sending HTLCs to the remote peer.
210204
///
211205
/// The amount does not include any pending HTLCs which are not yet resolved (and, thus, whose
@@ -270,8 +264,8 @@ pub struct ChannelDetails {
270264
/// the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
271265
/// to use a limit as close as possible to the HTLC limit we can currently send.
272266
///
273-
/// See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
274-
/// [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
267+
/// See also [`ChannelDetails::next_outbound_htlc_minimum_msat`] and
268+
/// [`ChannelDetails::outbound_capacity_msat`].
275269
pub next_outbound_htlc_limit_msat: u64,
276270
/// The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
277271
/// [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
@@ -306,7 +300,6 @@ impl From<LdkChannelDetails> for ChannelDetails {
306300
// unwrap safety: This value will be `None` for objects serialized with LDK versions
307301
// prior to 0.0.115.
308302
feerate_sat_per_1000_weight: value.feerate_sat_per_1000_weight.unwrap(),
309-
balance_msat: value.balance_msat,
310303
outbound_capacity_msat: value.outbound_capacity_msat,
311304
inbound_capacity_msat: value.inbound_capacity_msat,
312305
confirmations_required: value.confirmations_required,

0 commit comments

Comments
 (0)