Skip to content

Commit e0e7bbd

Browse files
committed
Dont broadcast HTLC-Timeouts when closing a channel until locktime
1 parent d129504 commit e0e7bbd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lightning/src/chain/channelmonitor.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1906,6 +1906,11 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
19061906
// We can't build an HTLC-Success transaction without the preimage
19071907
continue;
19081908
}
1909+
} else if htlc.0.cltv_expiry > self.best_block.height() + 1 {
1910+
// Don't broadcast HTLC-Timeout transactions immediately as they dont' meet the
1911+
// current locktime requirements on-chain. We will broadcast them when the
1912+
// commitment transaction confirms automatically.
1913+
continue;
19091914
} else { None };
19101915
if let Some(htlc_tx) = self.onchain_tx_handler.get_fully_signed_htlc_tx(
19111916
&::bitcoin::OutPoint { txid, vout }, &preimage) {

0 commit comments

Comments
 (0)