Prevent duplicate PaymentSent events
[rust-lightning] / lightning / src / ln / functional_test_utils.rs
index 0389da4977c054c5e6f7f2836a8f27767fb73c9e..ffca2ecd5739060f67cd4c486dbe8b660b4f32a6 100644 (file)
@@ -1242,9 +1242,11 @@ pub fn claim_payment_along_route<'a, 'b, 'c>(origin_node: &Node<'a, 'b, 'c>, exp
 
                if !skip_last {
                        last_update_fulfill_dance!(origin_node, expected_route.first().unwrap());
-                       expect_payment_sent!(origin_node, our_payment_preimage);
                }
        }
+       if !skip_last {
+               expect_payment_sent!(origin_node, our_payment_preimage);
+       }
 }
 
 pub fn claim_payment<'a, 'b, 'c>(origin_node: &Node<'a, 'b, 'c>, expected_route: &[&Node<'a, 'b, 'c>], our_payment_preimage: PaymentPreimage) {