From bdabb247346d04aec991181b73686dcb5f0ebf40 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 2 Nov 2017 10:22:39 +1030 Subject: [PATCH] lightningd: note our complience on not forwarding an HTLC post deadline. Signed-off-by: Rusty Russell --- lightningd/peer_htlcs.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lightningd/peer_htlcs.c b/lightningd/peer_htlcs.c index c235bc17f..950b4d0db 100644 --- a/lightningd/peer_htlcs.c +++ b/lightningd/peer_htlcs.c @@ -647,6 +647,16 @@ static bool peer_accepted_htlc(struct peer *peer, goto out; } + /* BOLT #2: + * + * A node MUST estimate a fulfillment deadline for each HTLC it is + * attempting to fulfill. A node MUST fail (and not forward) an HTLC + * whose fulfillment deadline is already past + */ + /* Our deadline is half the cltv_delta we insist on, so this check is + * a subset of the cltv check done in handle_localpay and + * forward_htlc. */ + /* channeld tests this, so it should have set ss to zeroes. */ op = parse_onionpacket(tmpctx, hin->onion_routing_packet, sizeof(hin->onion_routing_packet));