From 34792d0f1a07ce6be94546be4bf9ddbe3e6adb19 Mon Sep 17 00:00:00 2001 From: Jeffrey Czyz Date: Fri, 2 Apr 2021 15:31:20 -0700 Subject: [PATCH] Remove unnecessary script_pubkey clones --- lightning/src/chain/chainmonitor.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lightning/src/chain/chainmonitor.rs b/lightning/src/chain/chainmonitor.rs index ecdd6c3f2..63e1a7da5 100644 --- a/lightning/src/chain/chainmonitor.rs +++ b/lightning/src/chain/chainmonitor.rs @@ -146,15 +146,15 @@ where C::Target: chain::Filter, // transactions from within the block that previously had not been included in txdata. if let Some(ref chain_source) = self.chain_source { let block_hash = header.block_hash(); - for (txid, outputs) in txn_outputs.drain(..) { - for (idx, output) in outputs.iter() { + for (txid, mut outputs) in txn_outputs.drain(..) { + for (idx, output) in outputs.drain(..) { // Register any new outputs with the chain source for filtering and recurse // if it indicates that there are dependent transactions within the block // that had not been previously included in txdata. let output = WatchedOutput { block_hash: Some(block_hash), - outpoint: OutPoint { txid, index: *idx as u16 }, - script_pubkey: output.script_pubkey.clone(), + outpoint: OutPoint { txid, index: idx as u16 }, + script_pubkey: output.script_pubkey, }; if let Some(tx) = chain_source.register_output(output) { dependent_txdata.push(tx); -- 2.39.5