Generate PaymentPathSuccessful event for each path
[rust-lightning] / lightning / src / ln / onion_route_tests.rs
index f3681946d194f614583c64488bb809103fccc9ec..e80cf98d7b9b358e7713f21447a9f7516d5ed3f0 100644 (file)
@@ -477,6 +477,11 @@ fn test_onion_failure() {
        bogus_route.paths[0][route_len-1].fee_msat = amt_to_forward;
        run_onion_failure_test("amount_below_minimum", 0, &nodes, &bogus_route, &payment_hash, &payment_secret, |_| {}, ||{}, true, Some(UPDATE|11), Some(NetworkUpdate::ChannelUpdateMessage{msg: ChannelUpdate::dummy(short_channel_id)}), Some(short_channel_id));
 
+       // Clear pending payments so that the following positive test has the correct payment hash.
+       for node in nodes.iter() {
+               node.node.clear_pending_payments();
+       }
+
        // Test a positive test-case with one extra msat, meeting the minimum.
        bogus_route.paths[0][route_len-1].fee_msat = amt_to_forward + 1;
        let preimage = send_along_route(&nodes[0], bogus_route, &[&nodes[1], &nodes[2]], amt_to_forward+1).0;