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

Function check_cltv

lightningd/peer_htlcs.c:306–315  ·  view source on GitHub ↗

BOLT #4: * * * `outgoing_cltv_value`: The CLTV value that the _outgoing_ HTLC carrying * the packet should have. * * cltv_expiry - cltv_expiry_delta >= outgoing_cltv_value * * Inclusion of this field allows a hop to both authenticate the * information specified by the origin node, and the parameters of the * HTLC forwarded, and ensure the origin node is using the c

Source from the content-addressed store, hash-verified

304 * the route.
305 */
306static bool check_cltv(struct htlc_in *hin,
307 u32 cltv_expiry, u32 outgoing_cltv_value, u32 delta)
308{
309 if (delta < cltv_expiry && cltv_expiry - delta >= outgoing_cltv_value)
310 return true;
311 log_debug(hin->key.channel->log, "HTLC %"PRIu64" incorrect CLTV:"
312 " %u in, %u out, delta reqd %u",
313 hin->key.id, cltv_expiry, outgoing_cltv_value, delta);
314 return false;
315}
316
317void fulfill_htlc(struct htlc_in *hin, const struct preimage *preimage)
318{

Callers 2

handle_localpayFunction · 0.85
forward_htlcFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected