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`. */
| 372 | * - incoming `cltv_expiry` < `outgoing_cltv_value`. |
| 373 | */ |
| 374 | static bool check_cltv(struct htlc_in *hin, |
| 375 | u32 cltv_expiry, u32 outgoing_cltv_value, u32 delta) |
| 376 | { |
| 377 | if (delta < cltv_expiry && cltv_expiry - delta >= outgoing_cltv_value) |
| 378 | return true; |
| 379 | log_debug(hin->key.channel->log, "HTLC %"PRIu64" incorrect CLTV:" |
| 380 | " %u in, %u out, delta reqd %u", |
| 381 | hin->key.id, cltv_expiry, outgoing_cltv_value, delta); |
| 382 | return false; |
| 383 | } |
| 384 | |
| 385 | void fulfill_htlc(struct htlc_in *hin, const struct preimage *preimage) |
| 386 | { |
no outgoing calls
no test coverage detected