From a84e5ca8fc3b1b45da6a9d7e688f30d95932db82 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 7 Apr 2023 16:06:17 +0930 Subject: [PATCH] Makefile: update bolts fc40879995ebc61cc50dfd729512f17afb15b355. "Allow nodes to overshoot the MPP `total_msat` when paying (#1031)" Signed-off-by: Rusty Russell Changelog-Changed: Protocol: Allow slight overpaying, even with MPP, as spec now recommends. --- Makefile | 2 +- lightningd/htlc_set.c | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index dd6a0007159b..2d3c0bd042fd 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ CCANDIR := ccan # Where we keep the BOLT RFCs BOLTDIR := ../bolts/ -DEFAULT_BOLTVERSION := 60cfb5972ad4bec4c49ee0f9e729fb3352fcdc6a +DEFAULT_BOLTVERSION := fc40879995ebc61cc50dfd729512f17afb15b355 # Can be overridden on cmdline. BOLTVERSION := $(DEFAULT_BOLTVERSION) diff --git a/lightningd/htlc_set.c b/lightningd/htlc_set.c index 9f36ae8b83fd..8a261c298d16 100644 --- a/lightningd/htlc_set.c +++ b/lightningd/htlc_set.c @@ -175,10 +175,6 @@ void htlc_set_add(struct lightningd *ld, return; } - /* BOLT #4: - * - if the total `amount_msat` of this HTLC set equals `total_msat`: - * - SHOULD fulfill all HTLCs in the HTLC set - */ if (!amount_msat_add(&set->so_far, set->so_far, hin->msat)) { log_unusual(ld->log, "Failing HTLC set %s:" " overflow adding %s+%s", @@ -202,7 +198,12 @@ void htlc_set_add(struct lightningd *ld, payment_secret ? "" : "no " ); - if (amount_msat_eq(set->so_far, total_msat)) { + /* BOLT #4: + * - if the total `amount_msat` of this HTLC set is equal to or greater than + * `total_msat`: + * - SHOULD fulfill all HTLCs in the HTLC set + */ + if (amount_msat_greater_eq(set->so_far, total_msat)) { /* Disable timer now, in case invoice_hook is slow! */ tal_free(set->timeout); invoice_try_pay(ld, set, details);