Fix HTLC exclusion balance calculation criteria 2018-07-send-initial
authorMatt Corallo <git@bluematt.me>
Tue, 24 Jul 2018 19:01:56 +0000 (15:01 -0400)
committerMatt Corallo <git@bluematt.me>
Tue, 24 Jul 2018 19:11:38 +0000 (15:11 -0400)
src/ln/channel.rs

index 5b5604838fc852cecba93454c65578db9c35ec13..76d6f43e217b23f99bcd9aa0f4861a51e9e5d309 100644 (file)
@@ -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;
                                                }
                                        },