From 189b2f131317dc9d1b2392a2e48fb36d0ff59e86 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 28 Aug 2019 13:36:17 +0930 Subject: [PATCH] BOLT: update CSV to latest bolt version. This removes the WIRE_FINAL_EXPIRY_TOO_SOON which leaked too much info, and adds the blockheight to WIRE_INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS. Signed-off-by: Rusty Russell --- channeld/channeld.c | 6 +----- lightningd/peer_htlcs.c | 3 +-- wire/extracted_onion_wire_csv | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/channeld/channeld.c b/channeld/channeld.c index b47d0c240..7f45a6be1 100644 --- a/channeld/channeld.c +++ b/channeld/channeld.c @@ -943,11 +943,7 @@ static u8 *make_failmsg(const tal_t *ctx, case WIRE_INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS: assert(failheight); msg = towire_incorrect_or_unknown_payment_details( - ctx, htlc->amount); - goto done; - case WIRE_FINAL_EXPIRY_TOO_SOON: - assert(failheight); - msg = towire_final_expiry_too_soon(ctx); + ctx, htlc->amount, failheight); goto done; case WIRE_FINAL_INCORRECT_CLTV_EXPIRY: msg = towire_final_incorrect_cltv_expiry(ctx, cltv_expiry); diff --git a/lightningd/peer_htlcs.c b/lightningd/peer_htlcs.c index 3bf82759f..597fe860f 100644 --- a/lightningd/peer_htlcs.c +++ b/lightningd/peer_htlcs.c @@ -319,8 +319,7 @@ static void handle_localpay(struct htlc_in *hin, cltv_expiry, get_block_height(ld->topology), ld->config.cltv_final); - /* FIXME! */ - failcode = WIRE_FINAL_EXPIRY_TOO_SOON; + failcode = WIRE_INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS; goto fail; } diff --git a/wire/extracted_onion_wire_csv b/wire/extracted_onion_wire_csv index c9c529292..602599a4f 100644 --- a/wire/extracted_onion_wire_csv +++ b/wire/extracted_onion_wire_csv @@ -38,7 +38,7 @@ msgdata,expiry_too_soon,len,u16, msgdata,expiry_too_soon,channel_update,byte,len msgtype,incorrect_or_unknown_payment_details,PERM|15 msgdata,incorrect_or_unknown_payment_details,htlc_msat,u64, -msgtype,final_expiry_too_soon,17 +msgdata,incorrect_or_unknown_payment_details,height,u32, msgtype,final_incorrect_cltv_expiry,18 msgdata,final_incorrect_cltv_expiry,cltv_expiry,u32, msgtype,final_incorrect_htlc_amount,19