From: Matt Corallo Date: Tue, 24 Jul 2018 19:01:56 +0000 (-0400) Subject: Fix HTLC exclusion balance calculation criteria X-Git-Tag: v0.0.12~371^2 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=refs%2Fheads%2F2018-07-send-initial;p=rust-lightning Fix HTLC exclusion balance calculation criteria --- diff --git a/src/ln/channel.rs b/src/ln/channel.rs index 5b5604838..76d6f43e2 100644 --- a/src/ln/channel.rs +++ b/src/ln/channel.rs @@ -660,8 +660,13 @@ impl Channel { value_to_self_msat_offset -= htlc.amount_msat as i64; } }, + HTLCState::RemoteRemoved => { + if !generated_by_local && htlc.fail_reason.is_none() { + value_to_self_msat_offset -= htlc.amount_msat as i64; + } + }, HTLCState::LocalRemoved => { - if !generated_by_local && htlc.local_removed_fulfilled { + if generated_by_local && htlc.local_removed_fulfilled { value_to_self_msat_offset += htlc.amount_msat as i64; } },