Skip to content

Commit

Permalink
Makefile: update bolts fc40879995ebc61cc50dfd729512f17afb15b355.
Browse files Browse the repository at this point in the history
"Allow nodes to overshoot the MPP `total_msat` when paying (ElementsProject#1031)"

Signed-off-by: Rusty Russell <[email protected]>
Changelog-Changed: Protocol: Allow slight overpaying, even with MPP, as spec now recommends.
  • Loading branch information
rustyrussell authored and ddustin committed May 12, 2023
1 parent 47731be commit a4ca75f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
11 changes: 6 additions & 5 deletions lightningd/htlc_set.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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);
Expand Down

0 comments on commit a4ca75f

Please sign in to comment.