Skip to content

Commit 34792d0

Browse files
committed
Remove unnecessary script_pubkey clones
1 parent f57c885 commit 34792d0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lightning/src/chain/chainmonitor.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,15 @@ where C::Target: chain::Filter,
146146
// transactions from within the block that previously had not been included in txdata.
147147
if let Some(ref chain_source) = self.chain_source {
148148
let block_hash = header.block_hash();
149-
for (txid, outputs) in txn_outputs.drain(..) {
150-
for (idx, output) in outputs.iter() {
149+
for (txid, mut outputs) in txn_outputs.drain(..) {
150+
for (idx, output) in outputs.drain(..) {
151151
// Register any new outputs with the chain source for filtering and recurse
152152
// if it indicates that there are dependent transactions within the block
153153
// that had not been previously included in txdata.
154154
let output = WatchedOutput {
155155
block_hash: Some(block_hash),
156-
outpoint: OutPoint { txid, index: *idx as u16 },
157-
script_pubkey: output.script_pubkey.clone(),
156+
outpoint: OutPoint { txid, index: idx as u16 },
157+
script_pubkey: output.script_pubkey,
158158
};
159159
if let Some(tx) = chain_source.register_output(output) {
160160
dependent_txdata.push(tx);

0 commit comments

Comments
 (0)