From 2b92ac423601413f740ca645ba21f394c0e202dc Mon Sep 17 00:00:00 2001 From: William Casarin Date: Thu, 10 Feb 2022 09:22:17 -0800 Subject: [PATCH] bolt11: mark when expiry is decoded It looks like the x tag isn't marked when parsed either? --- common/bolt11.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/bolt11.c b/common/bolt11.c index 190e433f3..490c7b9ef 100644 --- a/common/bolt11.c +++ b/common/bolt11.c @@ -224,7 +224,7 @@ static void decode_h(struct bolt11 *b11, static char *decode_x(struct bolt11 *b11, struct hash_u5 *hu5, u5 **data, size_t *data_len, - size_t data_length, const bool *have_x) + size_t data_length, bool *have_x) { if (*have_x) return unknown_field(b11, hu5, data, data_len, 'x', @@ -234,6 +234,8 @@ static char *decode_x(struct bolt11 *b11, if (!pull_uint(hu5, data, data_len, &b11->expiry, data_length * 5)) return tal_fmt(b11, "x: length %zu chars is excessive", *data_len); + + *have_x = true; return NULL; }