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 <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2025-06-30 10:08:28 +09:30
parent 9298e5c212
commit c0ff1b5768
2 changed files with 18 additions and 11 deletions

View File

@@ -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)

View File

@@ -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);
}