File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -314,6 +314,11 @@ impl OnchainTxHandler {
314
314
tx_weight
315
315
}
316
316
317
+ /// In LN, output claimed are time-sensitive, which means we have to spend them before reaching some timelock expiration. At in-channel
318
+ /// output detection, we generate a first version of a claim tx and associate to it a height timer. A height timer is an absolute block
319
+ /// height than once reached we should generate a new bumped "version" of the claim tx to be sure than we safely claim outputs before
320
+ /// than our counterparty can do it too. If timelock expires soon, height timer is going to be scale down in consequence to increase
321
+ /// frequency of the bump and so increase our bets of success.
317
322
fn get_height_timer ( current_height : u32 , timelock_expiration : u32 ) -> u32 {
318
323
if timelock_expiration <= current_height + 3 {
319
324
return current_height + 1
@@ -386,6 +391,8 @@ impl OnchainTxHandler {
386
391
}
387
392
}
388
393
394
+ // Compute new height timer to decide when we need to regenerate a new bumped version of the claim tx (if we
395
+ // didn't receive confirmation of it before, or not enough reorg-safe depth on top of it).
389
396
let new_timer = Self :: get_height_timer ( height, cached_claim_datas. soonest_timelock ) ;
390
397
let mut inputs_witnesses_weight = 0 ;
391
398
let mut total_amount = 0 ;
You can’t perform that action at this time.
0 commit comments