diff --git a/sn_node/src/put_validation.rs b/sn_node/src/put_validation.rs index eaf26cd732..656eadc8da 100644 --- a/sn_node/src/put_validation.rs +++ b/sn_node/src/put_validation.rs @@ -749,9 +749,7 @@ impl Node { } // keep track of double spend with double spent parent - let some_parents_double_spent = !double_spent_parent.is_empty(); - let we_re_double_spent = all_verified_spends.len() > 1; - if some_parents_double_spent && we_re_double_spent { + if !all_verified_spends.is_empty() && !double_spent_parent.is_empty() { warn!("Parent of {unique_pubkey:?} was double spent, but it's also a double spend. So keeping track of this double spend attempt."); all_verified_spends.extend(double_spent_parent.into_iter()) } diff --git a/sn_node/tests/double_spend.rs b/sn_node/tests/double_spend.rs index 8c113a9ea2..7c253f618e 100644 --- a/sn_node/tests/double_spend.rs +++ b/sn_node/tests/double_spend.rs @@ -334,6 +334,7 @@ async fn parent_and_child_double_spends_should_lead_to_cashnote_being_invalid() reason.clone(), )?; + info!("spend B to C: {:?}", transfer_to_c.all_spend_requests); client .send_spends(transfer_to_c.all_spend_requests.iter(), false) .await?; @@ -386,9 +387,18 @@ async fn parent_and_child_double_spends_should_lead_to_cashnote_being_invalid() wallet_b.address(), reason.clone(), )?; // reuse the old cash notes + + info!("spend B to Y: {:?}", transfer_to_y.all_spend_requests); client .send_spends(transfer_to_y.all_spend_requests.iter(), false) .await?; + let spend_b_to_y = transfer_to_y + .all_spend_requests + .first() + .expect("should have one"); + let b_spends = client.get_spend_from_network(spend_b_to_y.address()).await; + info!("B spends: {b_spends:?}"); + info!("Verifying the transfers from B -> Y wallet... It should error out."); let cash_notes_for_y: Vec<_> = transfer_to_y.cash_notes_for_recipient.clone(); let result = client.verify_cashnote(&cash_notes_for_y[0]).await;