Skip to content

Commit 25644ac

Browse files
committed
Dont broadcast HTLC-Timeouts when closing a channel until locktime
1 parent af44ec2 commit 25644ac

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

0 commit comments

Comments
 (0)