Skip to content

Commit a979c33

Browse files
committed
Don't broadcast manual-funded chan closing txn on HTLC timeouts
In 6c5ef04 we prevented broadcast of the commitment transactions if the funding transaction has not yet appeared on-chain for manual-broadcast channels to avoid spurious bumps or unbroadcastable transactions. However, we missed the case where a channel is closed due to HTLCs timing out. Here we fix that by doing the same broadcast-gating when automatically force-closing a channel due to HTLC timeouts.
1 parent 64bb44c commit a979c33

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lightning/src/chain/channelmonitor.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5664,8 +5664,12 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
56645664
let reason = ClosureReason::HTLCsTimedOut { payment_hash: Some(payment_hash) };
56655665
let (mut new_outpoints, mut new_outputs) =
56665666
self.generate_claimable_outpoints_and_watch_outputs(Some(reason), false);
5667-
claimable_outpoints.append(&mut new_outpoints);
5668-
watch_outputs.append(&mut new_outputs);
5667+
if !self.is_manual_broadcast || self.funding_seen_onchain {
5668+
claimable_outpoints.append(&mut new_outpoints);
5669+
watch_outputs.append(&mut new_outputs);
5670+
} else {
5671+
log_info!(logger, "Not broadcasting holder commitment for manual-broadcast channel before funding appears on-chain");
5672+
}
56695673
}
56705674
}
56715675

0 commit comments

Comments
 (0)