From c0ff1b576875f065d0d0451cea3861d3f18ade49 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 30 Jun 2025 10:08:28 +0930 Subject: [PATCH] lightningd: update comments about known preimages for missing HTLC outputs. Doesn't change anything for us, since we will already fulfull the incoming HTLCs if we can, but good to note. Signed-off-by: Rusty Russell --- Makefile | 2 +- lightningd/onchain_control.c | 27 +++++++++++++++++---------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 06967ec52..1eee2c554 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ CCANDIR := ccan # Where we keep the BOLT RFCs BOLTDIR := ../bolts/ -DEFAULT_BOLTVERSION := 79101063c3e54a563f03eb6047c8c65644408f03 +DEFAULT_BOLTVERSION := 216914d492ecdf8a814bbab34fa9f6d31b394b98 # Can be overridden on cmdline. BOLTVERSION := $(DEFAULT_BOLTVERSION) diff --git a/lightningd/onchain_control.c b/lightningd/onchain_control.c index 725e434a5..0fe32e4d9 100644 --- a/lightningd/onchain_control.c +++ b/lightningd/onchain_control.c @@ -120,11 +120,14 @@ static bool tell_if_missing(const struct channel *channel, * * - for any committed HTLC that does NOT have an output in this * commitment transaction: - * - once the commitment transaction has reached reasonable depth: - * - MUST fail the corresponding incoming HTLC (if any). - * - if no *valid* commitment transaction contains an output - * corresponding to the HTLC. - * - MAY fail the corresponding incoming HTLC sooner. + * - if the payment preimage is known: + * - MUST fulfill the corresponding incoming HTLC (if any). + * - otherwise: + * - once the commitment transaction has reached reasonable depth: + * - MUST fail the corresponding incoming HTLC (if any). + * - if no *valid* commitment transaction contains an output + * corresponding to the HTLC: + * - MAY fail the corresponding incoming HTLC sooner. */ if (hout->hstate >= RCVD_ADD_REVOCATION && hout->hstate < SENT_REMOVE_REVOCATION) @@ -484,12 +487,16 @@ static void handle_missing_htlc_output(struct channel *channel, const u8 *msg) * * - for any committed HTLC that does NOT have an output in this * commitment transaction: - * - once the commitment transaction has reached reasonable depth: - * - MUST fail the corresponding incoming HTLC (if any). - * - if no *valid* commitment transaction contains an output - * corresponding to the HTLC. - * - MAY fail the corresponding incoming HTLC sooner. + * - if the payment preimage is known: + * - MUST fulfill the corresponding incoming HTLC (if any). + * - otherwise: + * - once the commitment transaction has reached reasonable depth: + * - MUST fail the corresponding incoming HTLC (if any). + * - if no *valid* commitment transaction contains an output + * corresponding to the HTLC: + * - MAY fail the corresponding incoming HTLC sooner. */ + /* Note: we already succeeded any incoming which we preimage for */ onchain_failed_our_htlc(channel, &htlc, "missing in commitment tx", false); }