Skip to content

Commit 0af58a6

Browse files
author
Antoine Riard
committed
Remove superflous pending_claims
As local onchain txn are already monitored in block_connected by check_spend_local_transaction, it's useless to generate twice pending claims for HTLC outputs on local commitment tx. We could do the alternative.
1 parent 2f952fc commit 0af58a6

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lightning/src/ln/channelmonitor.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2279,16 +2279,14 @@ impl ChannelMonitor {
22792279
}
22802280
}
22812281
}
2282-
let mut pending_claims = Vec::new();
22832282
if let Some(ref cur_local_tx) = self.current_local_signed_commitment_tx {
22842283
if self.would_broadcast_at_height(height) {
22852284
log_trace!(self, "Broadcast onchain {}", log_tx!(cur_local_tx.tx));
22862285
broadcaster.broadcast_transaction(&cur_local_tx.tx);
22872286
match self.key_storage {
22882287
Storage::Local { ref delayed_payment_base_key, ref latest_per_commitment_point, .. } => {
2289-
let (txs, mut spendable_output, new_outputs, mut pending_txn) = self.broadcast_by_local_state(&cur_local_tx, latest_per_commitment_point, &Some(*delayed_payment_base_key), height);
2288+
let (txs, mut spendable_output, new_outputs, _) = self.broadcast_by_local_state(&cur_local_tx, latest_per_commitment_point, &Some(*delayed_payment_base_key), height);
22902289
spendable_outputs.append(&mut spendable_output);
2291-
pending_claims.append(&mut pending_txn);
22922290
if !new_outputs.is_empty() {
22932291
watch_outputs.push((cur_local_tx.txid.clone(), new_outputs));
22942292
}
@@ -2298,9 +2296,8 @@ impl ChannelMonitor {
22982296
}
22992297
},
23002298
Storage::Watchtower { .. } => {
2301-
let (txs, mut spendable_output, new_outputs, mut pending_txn) = self.broadcast_by_local_state(&cur_local_tx, &None, &None, height);
2299+
let (txs, mut spendable_output, new_outputs, _) = self.broadcast_by_local_state(&cur_local_tx, &None, &None, height);
23022300
spendable_outputs.append(&mut spendable_output);
2303-
pending_claims.append(&mut pending_txn);
23042301
if !new_outputs.is_empty() {
23052302
watch_outputs.push((cur_local_tx.txid.clone(), new_outputs));
23062303
}

0 commit comments

Comments
 (0)