Skip to content

Commit 347a375

Browse files
committed
Remove unnecessary drain
1 parent d9c20be commit 347a375

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lightning/src/ln/channel.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3588,7 +3588,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
35883588
}
35893589
bitcoin_tx.txid
35903590
};
3591-
let mut htlcs_cloned: Vec<_> = commitment_data.htlcs_included.iter().map(|htlc| (htlc.0.clone(), htlc.1.map(|h| h.clone()))).collect();
3591+
let htlcs_cloned: Vec<_> = commitment_data.htlcs_included.iter().map(|htlc| (htlc.0.clone(), htlc.1.map(|h| h.clone()))).collect();
35923592

35933593
// If our counterparty updated the channel fee in this commitment transaction, check that
35943594
// they can actually afford the new fee now.
@@ -3627,7 +3627,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
36273627
let holder_keys = commitment_data.stats.tx.trust().keys();
36283628
let mut nondust_htlc_sources = Vec::with_capacity(commitment_data.stats.tx.htlcs().len());
36293629
let mut dust_htlcs = Vec::with_capacity(htlcs_cloned.len() - commitment_data.stats.tx.htlcs().len());
3630-
for (idx, (htlc, mut source_opt)) in htlcs_cloned.drain(..).enumerate() {
3630+
for (idx, (htlc, mut source_opt)) in htlcs_cloned.into_iter().enumerate() {
36313631
if let Some(_) = htlc.transaction_output_index {
36323632
let htlc_tx = chan_utils::build_htlc_transaction(&commitment_txid, commitment_data.stats.tx.feerate_per_kw(),
36333633
funding.get_counterparty_selected_contest_delay().unwrap(), &htlc, funding.get_channel_type(),

0 commit comments

Comments
 (0)