Skip to content

Commit c0ff1b5

Browse files
committed
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 <[email protected]>
1 parent 9298e5c commit c0ff1b5

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ CCANDIR := ccan
2626

2727
# Where we keep the BOLT RFCs
2828
BOLTDIR := ../bolts/
29-
DEFAULT_BOLTVERSION := 79101063c3e54a563f03eb6047c8c65644408f03
29+
DEFAULT_BOLTVERSION := 216914d492ecdf8a814bbab34fa9f6d31b394b98
3030
# Can be overridden on cmdline.
3131
BOLTVERSION := $(DEFAULT_BOLTVERSION)
3232

lightningd/onchain_control.c

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,14 @@ static bool tell_if_missing(const struct channel *channel,
120120
*
121121
* - for any committed HTLC that does NOT have an output in this
122122
* commitment transaction:
123-
* - once the commitment transaction has reached reasonable depth:
124-
* - MUST fail the corresponding incoming HTLC (if any).
125-
* - if no *valid* commitment transaction contains an output
126-
* corresponding to the HTLC.
127-
* - MAY fail the corresponding incoming HTLC sooner.
123+
* - if the payment preimage is known:
124+
* - MUST fulfill the corresponding incoming HTLC (if any).
125+
* - otherwise:
126+
* - once the commitment transaction has reached reasonable depth:
127+
* - MUST fail the corresponding incoming HTLC (if any).
128+
* - if no *valid* commitment transaction contains an output
129+
* corresponding to the HTLC:
130+
* - MAY fail the corresponding incoming HTLC sooner.
128131
*/
129132
if (hout->hstate >= RCVD_ADD_REVOCATION
130133
&& hout->hstate < SENT_REMOVE_REVOCATION)
@@ -484,12 +487,16 @@ static void handle_missing_htlc_output(struct channel *channel, const u8 *msg)
484487
*
485488
* - for any committed HTLC that does NOT have an output in this
486489
* commitment transaction:
487-
* - once the commitment transaction has reached reasonable depth:
488-
* - MUST fail the corresponding incoming HTLC (if any).
489-
* - if no *valid* commitment transaction contains an output
490-
* corresponding to the HTLC.
491-
* - MAY fail the corresponding incoming HTLC sooner.
490+
* - if the payment preimage is known:
491+
* - MUST fulfill the corresponding incoming HTLC (if any).
492+
* - otherwise:
493+
* - once the commitment transaction has reached reasonable depth:
494+
* - MUST fail the corresponding incoming HTLC (if any).
495+
* - if no *valid* commitment transaction contains an output
496+
* corresponding to the HTLC:
497+
* - MAY fail the corresponding incoming HTLC sooner.
492498
*/
499+
/* Note: we already succeeded any incoming which we preimage for */
493500
onchain_failed_our_htlc(channel, &htlc, "missing in commitment tx", false);
494501
}
495502

0 commit comments

Comments
 (0)