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
| 304 | * the route. |
| 305 | */ |
| 306 | static 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 | |
| 317 | void fulfill_htlc(struct htlc_in *hin, const struct preimage *preimage) |
| 318 | { |
no outgoing calls
no test coverage detected