X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Fchannel.rs;h=f702fc4843eea3d8f8a4db11a2eda446aa9d6392;hb=bd90bd20558395a706be8dfc7ed2ff0af3185e8d;hp=fda5d71285140291d1cc93cc18c1123037ec72bb;hpb=01847277b957ec94129141a7e7439ae539c094f1;p=rust-lightning diff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs index fda5d712..f702fc48 100644 --- a/lightning/src/ln/channel.rs +++ b/lightning/src/ln/channel.rs @@ -65,8 +65,6 @@ pub struct ChannelValueStat { } pub struct AvailableBalances { - /// The amount that would go to us if we close the channel, ignoring any on-chain fees. - pub balance_msat: u64, /// Total amount available for our counterparty to send to us. pub inbound_capacity_msat: u64, /// Total amount available for us to send to our counterparty. @@ -1598,14 +1596,6 @@ impl ChannelContext { let inbound_stats = context.get_inbound_pending_htlc_stats(None); let outbound_stats = context.get_outbound_pending_htlc_stats(None); - let mut balance_msat = context.value_to_self_msat; - for ref htlc in context.pending_inbound_htlcs.iter() { - if let InboundHTLCState::LocalRemoved(InboundHTLCRemovalReason::Fulfill(_)) = htlc.state { - balance_msat += htlc.amount_msat; - } - } - balance_msat -= outbound_stats.pending_htlcs_value_msat; - let outbound_capacity_msat = context.value_to_self_msat .saturating_sub(outbound_stats.pending_htlcs_value_msat) .saturating_sub( @@ -1722,7 +1712,6 @@ impl ChannelContext { outbound_capacity_msat, next_outbound_htlc_limit_msat: available_capacity_msat, next_outbound_htlc_minimum_msat, - balance_msat, } }