Skip to content

Commit f541062

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

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
@@ -1905,6 +1905,11 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
19051905
// We can't build an HTLC-Success transaction without the preimage
19061906
continue;
19071907
}
1908+
} else if htlc.0.cltv_expiry > self.best_block.height() + 1 {
1909+
// Don't broadcast HTLC-Timeout transactions immediately as they dont' meet the
1910+
// current locktime requirements on-chain. We will broadcast them when the
1911+
// commitment transaction confirms automatically.
1912+
continue;
19081913
} else { None };
19091914
if let Some(htlc_tx) = self.onchain_tx_handler.get_fully_signed_htlc_tx(
19101915
&::bitcoin::OutPoint { txid, vout }, &preimage) {

0 commit comments

Comments
 (0)