From 48990a9efc3b847d49da5af29c35bec586acb234 Mon Sep 17 00:00:00 2001 From: Joost Jager Date: Tue, 26 May 2026 09:49:58 +0200 Subject: [PATCH] Track chanmon claims on PaymentClaimed events Only record receiver claims in the fuzz payment tracker after the node emits PaymentClaimed. This keeps the tracker aligned with durable claim completion instead of a claim_funds call that a restart may roll back. --- fuzz/src/chanmon_consistency.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fuzz/src/chanmon_consistency.rs b/fuzz/src/chanmon_consistency.rs index a0aa7bbe7ef..6f9ec14dcfb 100644 --- a/fuzz/src/chanmon_consistency.rs +++ b/fuzz/src/chanmon_consistency.rs @@ -1940,10 +1940,13 @@ impl PaymentTracker { .get(&payment_hash) .expect("PaymentClaimable for unknown payment hash"); node.claim_funds(payment_preimage); - self.claimed_payment_hashes.insert(payment_hash); } } + fn mark_claimed(&mut self, payment_hash: PaymentHash) { + self.claimed_payment_hashes.insert(payment_hash); + } + fn assert_all_resolved(&self) { for (idx, node) in self.nodes.iter().enumerate() { assert!( @@ -2801,7 +2804,9 @@ impl<'a, Out: Output + MaybeSend + MaybeSync> Harness<'a, Out> { | events::Event::ProbeFailed { payment_id, .. } => { payments.nodes[node_idx].mark_resolved_without_hash(payment_id); }, - events::Event::PaymentClaimed { .. } => {}, + events::Event::PaymentClaimed { payment_hash, .. } => { + payments.mark_claimed(payment_hash); + }, events::Event::PaymentPathSuccessful { .. } => {}, events::Event::PaymentPathFailed { .. } => {}, events::Event::PaymentForwarded { .. } if node_idx == 1 => {},