Skip to content

Commit ed264dd

Browse files
Antoine RiardTheBlueMatt
authored andcommitted
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 a14617c commit ed264dd

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
@@ -2383,16 +2383,14 @@ impl ChannelMonitor {
23832383
}
23842384
}
23852385
}
2386-
let mut pending_claims = Vec::new();
23872386
if let Some(ref cur_local_tx) = self.current_local_signed_commitment_tx {
23882387
if self.would_broadcast_at_height(height) {
23892388
log_trace!(self, "Broadcast onchain {}", log_tx!(cur_local_tx.tx));
23902389
broadcaster.broadcast_transaction(&cur_local_tx.tx);
23912390
match self.key_storage {
23922391
Storage::Local { ref delayed_payment_base_key, ref latest_per_commitment_point, .. } => {
2393-
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);
2392+
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);
23942393
spendable_outputs.append(&mut spendable_output);
2395-
pending_claims.append(&mut pending_txn);
23962394
if !new_outputs.is_empty() {
23972395
watch_outputs.push((cur_local_tx.txid.clone(), new_outputs));
23982396
}
@@ -2402,9 +2400,8 @@ impl ChannelMonitor {
24022400
}
24032401
},
24042402
Storage::Watchtower { .. } => {
2405-
let (txs, mut spendable_output, new_outputs, mut pending_txn) = self.broadcast_by_local_state(&cur_local_tx, &None, &None, height);
2403+
let (txs, mut spendable_output, new_outputs, _) = self.broadcast_by_local_state(&cur_local_tx, &None, &None, height);
24062404
spendable_outputs.append(&mut spendable_output);
2407-
pending_claims.append(&mut pending_txn);
24082405
if !new_outputs.is_empty() {
24092406
watch_outputs.push((cur_local_tx.txid.clone(), new_outputs));
24102407
}

0 commit comments

Comments
 (0)