BOLT #4: * * - if it is not the final node: * - MUST return an error if: * ... * - `cltv_expiry` - `cltv_expiry_delta` < `outgoing_cltv_value` * - If it is the final node: *... * - MUST return an error if: *... * - incoming `cltv_expiry` < `outgoing_cltv_value`. */
| 416 | * - incoming `cltv_expiry` < `outgoing_cltv_value`. |
| 417 | */ |
| 418 | static bool check_cltv(struct htlc_in *hin, |
| 419 | u32 cltv_expiry, u32 outgoing_cltv_value, u32 delta) |
| 420 | { |
| 421 | if (delta < cltv_expiry && cltv_expiry - delta >= outgoing_cltv_value) |
| 422 | return true; |
| 423 | log_debug(hin->key.channel->log, "HTLC %"PRIu64" incorrect CLTV:" |
| 424 | " %u in, %u out, delta reqd %u", |
| 425 | hin->key.id, cltv_expiry, outgoing_cltv_value, delta); |
| 426 | return false; |
| 427 | } |
| 428 | |
| 429 | void fulfill_htlc(struct htlc_in *hin, const struct preimage *preimage) |
| 430 | { |
no outgoing calls
no test coverage detected