From d61abf6c04dce4f5349b38a9373f87b63aed4072 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 24 Jul 2018 15:01:56 -0400 Subject: [PATCH] Fix HTLC exclusion balance calculation criteria --- src/ln/channel.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; } }, -- 2.39.5