From 961987b046d1830c5908dffb9f7b1331b0b6d809 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 27 Apr 2017 13:48:40 +0930 Subject: [PATCH] lightningd: partial BOLT update. Not the new onion stuff for now. Signed-off-by: Rusty Russell --- lightningd/opening/opening.c | 6 +++--- lightningd/peer_control.c | 6 ++++-- wire/fromwire.c | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lightningd/opening/opening.c b/lightningd/opening/opening.c index ba42ba812..bd0149960 100644 --- a/lightningd/opening/opening.c +++ b/lightningd/opening/opening.c @@ -351,7 +351,7 @@ static u8 *open_channel(struct state *state, /* BOLT #2: * - * This message introduces the `channel-id` which identifies , which + * This message introduces the `channel-id` to identify the channel, which * is derived from the funding transaction by combining the * `funding-txid` and the `funding-output-index` using big-endian * exclusive-OR (ie. `funding-output-index` alters the last two @@ -590,8 +590,8 @@ static u8 *recv_channel(struct state *state, /* BOLT #2: * - * This message introduces the `channel-id` which identifies , which - * is derived from the funding transaction by combining the + * This message introduces the `channel-id` to identify the channel, + * which is derived from the funding transaction by combining the * `funding-txid` and the `funding-output-index` using big-endian * exclusive-OR (ie. `funding-output-index` alters the last two * bytes). diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index aad6ee561..146347afe 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -674,8 +674,10 @@ static void handle_localpay(struct htlc_end *hend, /* BOLT #4: * * If the amount paid is less than the amount expected, the final node - * MUST fail the HTLC. If the amount paid is more than the amount - * expected, the final node SHOULD fail the HTLC: + * MUST fail the HTLC. If the amount paid is more than twice the + * amount expected, the final node SHOULD fail the HTLC. This allows + * the sender to reduce information leakage by altering the amount, + * without allowing accidental gross overpayment: * * 1. type: PERM|16 (`incorrect_payment_amount`) */ diff --git a/wire/fromwire.c b/wire/fromwire.c index da7a4c2b7..b427e5eab 100644 --- a/wire/fromwire.c +++ b/wire/fromwire.c @@ -182,7 +182,7 @@ REGISTER_TYPE_TO_HEXSTR(channel_id); /* BOLT #2: * - * This message introduces the `channel-id` which identifies , which is + * This message introduces the `channel-id` to identify the channel, which is * derived from the funding transaction by combining the `funding-txid` and * the `funding-output-index` using big-endian exclusive-OR * (ie. `funding-output-index` alters the last two bytes).