MCPcopy Create free account
hub / github.com/ElementsProject/lightning / htlc_in_deadline

Function htlc_in_deadline

lightningd/peer_htlcs.c:2579–2583  ·  view source on GitHub ↗

BOLT #2: * * 3. the deadline for received HTLCs this node has fulfilled: the deadline * after which the channel has to be failed and the HTLC fulfilled on-chain * before its `cltv_expiry`. See steps 4-7 above, which imply a deadline of * `2R+G+S` blocks before `cltv_expiry`: 18 blocks is reasonable. */ We approximate this, by using half the cltv_expiry_delta (3R+2G+2S), * rounded up. */

Source from the content-addressed store, hash-verified

2577/* We approximate this, by using half the cltv_expiry_delta (3R+2G+2S),
2578 * rounded up. */
2579static u32 htlc_in_deadline(const struct lightningd *ld,
2580 const struct htlc_in *hin)
2581{
2582 return hin->cltv_expiry - (ld->config.cltv_expiry_delta + 1)/2;
2583}
2584
2585void htlcs_notify_new_block(struct lightningd *ld, u32 height)
2586{

Callers 1

htlcs_notify_new_blockFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected