Skip to content

Commit e286afd

Browse files
committed
Drop uneccessary indirection in map-updating in 1107ab0
1107ab0 added a Vec of future updates to apply during a loop, fixing a borrow checker issue that didn't exist in the merged version of the patch. This simply reverts that small part of the change.
1 parent b9db2ec commit e286afd

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

lightning/src/ln/onchaintx.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -713,18 +713,14 @@ impl<ChanSigner: ChannelKeys> OnchainTxHandler<ChanSigner> {
713713

714714
// Build, bump and rebroadcast tx accordingly
715715
log_trace!(self, "Bumping {} candidates", bump_candidates.len());
716-
let mut pending_claim_updates = Vec::with_capacity(bump_candidates.len());
717716
for (first_claim_txid, claim_material) in bump_candidates.iter() {
718717
if let Some((new_timer, new_feerate, bump_tx)) = self.generate_claim_tx(height, &claim_material, &*fee_estimator) {
719718
log_trace!(self, "Broadcast onchain {}", log_tx!(bump_tx));
720719
broadcaster.broadcast_transaction(&bump_tx);
721-
pending_claim_updates.push((*first_claim_txid, new_timer, new_feerate));
722-
}
723-
}
724-
for updates in pending_claim_updates {
725-
if let Some(claim_material) = self.pending_claim_requests.get_mut(&updates.0) {
726-
claim_material.height_timer = updates.1;
727-
claim_material.feerate_previous = updates.2;
720+
if let Some(claim_material) = self.pending_claim_requests.get_mut(first_claim_txid) {
721+
claim_material.height_timer = new_timer;
722+
claim_material.feerate_previous = new_feerate;
723+
}
728724
}
729725
}
730726
}

0 commit comments

Comments
 (0)