+ 'tx_iter: for tx in &txn_matched {
+ let txid = tx.txid();
+ // If a transaction has already been confirmed, ensure we don't bother processing it duplicatively.
+ if Some(txid) == self.funding_spend_confirmed {
+ log_debug!(logger, "Skipping redundant processing of funding-spend tx {} as it was previously confirmed", txid);
+ continue 'tx_iter;
+ }
+ for ev in self.onchain_events_awaiting_threshold_conf.iter() {
+ if ev.txid == txid {
+ if let Some(conf_hash) = ev.block_hash {
+ assert_eq!(header.block_hash(), conf_hash,
+ "Transaction {} was already confirmed and is being re-confirmed in a different block.\n\
+ This indicates a severe bug in the transaction connection logic - a reorg should have been processed first!", ev.txid);
+ }
+ log_debug!(logger, "Skipping redundant processing of confirming tx {} as it was previously confirmed", txid);
+ continue 'tx_iter;
+ }
+ }
+ for htlc in self.htlcs_resolved_on_chain.iter() {
+ if Some(txid) == htlc.resolving_txid {
+ log_debug!(logger, "Skipping redundant processing of HTLC resolution tx {} as it was previously confirmed", txid);
+ continue 'tx_iter;
+ }
+ }
+ for spendable_txid in self.spendable_txids_confirmed.iter() {
+ if txid == *spendable_txid {
+ log_debug!(logger, "Skipping redundant processing of spendable tx {} as it was previously confirmed", txid);
+ continue 'tx_iter;
+ }
+ }
+