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