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
+8-7Lines changed: 8 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ use secp256k1;
22
22
use chain::chaininterface::{BroadcasterInterface,ChainListener,ChainWatchInterface,FeeEstimator};
23
23
use chain::transaction::OutPoint;
24
24
use ln::channel::{Channel,ChannelError};
25
-
use ln::channelmonitor::{ChannelMonitor,ChannelMonitorUpdateErr,ManyChannelMonitor,CLTV_CLAIM_BUFFER,HTLC_FAIL_TIMEOUT_BLOCKS};
25
+
use ln::channelmonitor::{ChannelMonitor,ChannelMonitorUpdateErr,ManyChannelMonitor,CLTV_CLAIM_BUFFER,HTLC_FAIL_TIMEOUT_BLOCKS,HTLC_FAIL_ANTI_REORG_DELAY};
26
26
use ln::router::{Route,RouteHop};
27
27
use ln::msgs;
28
28
use ln::msgs::{ChannelMessageHandler,DecodeError,HandleError};
@@ -341,16 +341,17 @@ pub struct ChannelManager {
341
341
/// ie the node we forwarded the payment on to should always have enough room to reliably time out
342
342
/// the HTLC via a full update_fail_htlc/commitment_signed dance before we hit the
343
343
/// CLTV_CLAIM_BUFFER point (we static assert that its at least 3 blocks more).
344
-
constCLTV_EXPIRY_DELTA:u16 = 6*24*2;//TODO?
344
+
constCLTV_EXPIRY_DELTA:u16 = 6*12;//TODO?
345
345
constCLTV_FAR_FAR_AWAY:u32 = 6*24*7;//TODO?
346
346
347
-
// Check that our CLTV_EXPIRY is at least CLTV_CLAIM_BUFFER + 2*HTLC_FAIL_TIMEOUT_BLOCKS, ie that
348
-
// if the next-hop peer fails the HTLC within HTLC_FAIL_TIMEOUT_BLOCKS then we'll still have
349
-
// HTLC_FAIL_TIMEOUT_BLOCKS left to fail it backwards ourselves before hitting the
350
-
// CLTV_CLAIM_BUFFER point and failing the channel on-chain to time out the HTLC.
347
+
// Check that our CLTV_EXPIRY is at least CLTV_CLAIM_BUFFER + 2*HTLC_FAIL_TIMEOUT_BLOCKS +
348
+
// HTLC_FAIL_ANTI_REORG_DELAY, ie that if the next-hop peer fails the HTLC within
349
+
// HTLC_FAIL_TIMEOUT_BLOCKS then we'll still have HTLC_FAIL_TIMEOUT_BLOCKS left to fail it
350
+
// backwards ourselves before hitting the CLTV_CLAIM_BUFFER point and failing the channel
0 commit comments