From 48a17c23047897b41f429a35c13e47d7fc1c1948 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 5 Sep 2024 21:06:16 +0000 Subject: [PATCH] Rename claim cleaning match bool for accuracy We don't actually care if a confirmed transaction claimed other outputs, only that it claimed a superset of the outputs in the pending claim we're looking at. Thus, the variable to detect that is renamed `is_claim_subset_of_tx` instead of `are_sets_equal`. --- lightning/src/chain/onchaintx.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lightning/src/chain/onchaintx.rs b/lightning/src/chain/onchaintx.rs index 7ac8f9a63..39801638b 100644 --- a/lightning/src/chain/onchaintx.rs +++ b/lightning/src/chain/onchaintx.rs @@ -888,12 +888,12 @@ impl OnchainTxHandler { //... we need to verify equality between transaction outpoints and claim request // outpoints to know if transaction is the original claim or a bumped one issued // by us. - let mut are_sets_equal = true; + let mut is_claim_subset_of_tx = true; let mut tx_inputs = tx.input.iter().map(|input| &input.previous_output).collect::>(); tx_inputs.sort_unstable(); for request_input in request.outpoints() { if tx_inputs.binary_search(&request_input).is_err() { - are_sets_equal = false; + is_claim_subset_of_tx = false; break; } } @@ -915,7 +915,7 @@ impl OnchainTxHandler { // If this is our transaction (or our counterparty spent all the outputs // before we could anyway with same inputs order than us), wait for // ANTI_REORG_DELAY and clean the RBF tracking map. - if are_sets_equal { + if is_claim_subset_of_tx { clean_claim_request_after_safety_delay!(); } else { // If false, generate new claim request with update outpoint set let mut at_least_one_drop = false; -- 2.39.5