You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/ln/channelmanager.rs
+13-12Lines changed: 13 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ use secp256k1;
28
28
use chain::chaininterface::{BroadcasterInterface,ChainListener,ChainWatchInterface,FeeEstimator};
29
29
use chain::transaction::OutPoint;
30
30
use ln::channel::{Channel,ChannelError};
31
-
use ln::channelmonitor::{ChannelMonitor,ChannelMonitorUpdateErr,ManyChannelMonitor,CLTV_CLAIM_BUFFER,HTLC_FAIL_TIMEOUT_BLOCKS,HTLC_FAIL_ANTI_REORG_DELAY};
31
+
use ln::channelmonitor::{ChannelMonitor,ChannelMonitorUpdateErr,ManyChannelMonitor,CLTV_CLAIM_BUFFER,LATENCY_GRACE_PERIOD_BLOCKS,ANTI_REORG_DELAY};
return_err!("The final CLTV expiry is too soon to handle",17,&[0;0]);
846
847
}
847
848
// final_incorrect_htlc_amount
@@ -933,8 +934,8 @@ impl ChannelManager {
933
934
breakSome(("Forwarding node has tampered with the intended HTLC values or origin node has an obsolete cltv_expiry_delta",0x1000 | 13,Some(self.get_channel_update(chan).unwrap())));
934
935
}
935
936
let cur_height = self.latest_block_height.load(Ordering::Acquire)asu32 + 1;
936
-
// We want to have at least HTLC_FAIL_TIMEOUT_BLOCKS to fail prior to going on chain CLAIM_BUFFER blocks before expiration
937
-
if msg.cltv_expiry <= cur_height + CLTV_CLAIM_BUFFER + HTLC_FAIL_TIMEOUT_BLOCKSasu32{// expiry_too_soon
937
+
// We want to have at least LATENCY_GRACE_PERIOD_BLOCKS to fail prior to going on chain CLAIM_BUFFER blocks before expiration
938
+
if msg.cltv_expiry <= cur_height + CLTV_CLAIM_BUFFER + LATENCY_GRACE_PERIOD_BLOCKSasu32{// expiry_too_soon
938
939
breakSome(("CLTV expiry is too close",0x1000 | 14,Some(self.get_channel_update(chan).unwrap())));
939
940
}
940
941
if msg.cltv_expiry > cur_height + CLTV_FAR_FAR_AWAYasu32{// expiry_too_far
@@ -2489,7 +2490,7 @@ impl ChainListener for ChannelManager {
2489
2490
}
2490
2491
2491
2492
/// We force-close the channel without letting our counterparty participate in the shutdown
0 commit comments