Skip to content

Commit 294f8db

Browse files
endothermicdevcdecker
authored andcommitted
invoice: force inclusion of min_final_cltv_expiry for compatibility
As reported by @wtogami, LND nodes are using a default min_final_cltv_expiry_delta of 9, which makes them unable to pay invoices using the modern spec default of 18. Forcing inclusion of the c field allows interoperability until broader support of the 18 block default. Fixes: #6956 Changelog-Fixed: Default bolt11 invoices are payable by LND nodes.
1 parent 8067814 commit 294f8db

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

common/bolt11.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1327,8 +1327,10 @@ char *bolt11_encode_(const tal_t *ctx,
13271327
* - if the `c` field (`min_final_cltv_expiry_delta`) is not provided:
13281328
* - MUST use an expiry delta of at least 18 when making the payment
13291329
*/
1330-
if (b11->min_final_cltv_expiry != 18)
1331-
encode_c(&data, b11->min_final_cltv_expiry);
1330+
/* FIXME: Only encode if non-default once all implementations update
1331+
* default min_final_cltv_expiry_delta to 18. Forcing inclusion in the
1332+
* interrim to ensure compatibility with existing nodes. */
1333+
encode_c(&data, b11->min_final_cltv_expiry);
13321334

13331335
for (size_t i = 0; i < tal_count(b11->fallbacks); i++)
13341336
encode_f(&data, b11->fallbacks[i]);

common/test/run-bolt11.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,11 +494,11 @@ int main(int argc, char *argv[])
494494
badstr = bolt11_encode(tmpctx, b11, false, test_sign, NULL);
495495
assert(streq(badstr, "lnbc25m1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdq5vdhkven9v5sxyetpdeessp5zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygs9q4psqqqqqqqqqqqqqqqqsgqtqyx5vggfcsll4wu246hz02kp85x4katwsk9639we5n5yngc3yhqkm35jnjw4len8vrnqnf5ejh0mzj9n3vz2px97evektfm2l6wqccp3y7372"));
496496
dev_bolt11_old_order = false;
497-
dev_bolt11_omit_c_value = false;
498497

499498
/* Otherwise it does it normally */
500499
badstr = bolt11_encode(tmpctx, b11, false, test_sign, NULL);
501500
assert(streq(badstr, "lnbc25m1pvjluezsp5zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygspp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdq5vdhkven9v5sxyetpdees9q4psqqqqqqqqqqqqqqqqsgq8w9mkdh2n9pmrsg5natjffcgjpp5caamstsq5pm03v2c7ca5ej3plyrfe3vyzl76v6wex4r8rd6rdvys4a35983n6wrzegcwfl2gl4qqxh98vj"));
501+
dev_bolt11_omit_c_value = false;
502502

503503
/* Empty set of allowed bits, ensures this fails! */
504504
fset = tal(tmpctx, struct feature_set);

0 commit comments

Comments
 (0)