Skip to content

Commit c315490

Browse files
committed
Remove unnecessary script_pubkey clones
1 parent a512efa commit c315490

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
@@ -149,15 +149,15 @@ where C::Target: chain::Filter,
149149
// transactions from within the block that previously had not been included in txdata.
150150
if let Some(ref chain_source) = self.chain_source {
151151
let block_hash = header.block_hash();
152-
for (txid, outputs) in txn_outputs.drain(..) {
153-
for (idx, output) in outputs.iter() {
152+
for (txid, mut outputs) in txn_outputs.drain(..) {
153+
for (idx, output) in outputs.drain(..) {
154154
// Register any new outputs with the chain source for filtering and recurse
155155
// if it indicates that there are dependent transactions within the block
156156
// that had not been previously included in txdata.
157157
let output = WatchedOutput {
158158
block_hash: Some(block_hash),
159-
outpoint: OutPoint { txid, index: *idx as u16 },
160-
script_pubkey: output.script_pubkey.clone(),
159+
outpoint: OutPoint { txid, index: idx as u16 },
160+
script_pubkey: output.script_pubkey,
161161
};
162162
if let Some(tx) = chain_source.register_output(output) {
163163
dependent_txdata.push(tx);

0 commit comments

Comments
 (0)