common/bolt11: const cleanup, fix parsing errors.

Also, we don't need to pass the total length to the field parsers,
just the length for this field (confusingly, this was called
"data_length").

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2023-01-12 11:31:21 +10:30
committed by Alex Myers
parent 1fb1e0eec4
commit d9fed06b90
5 changed files with 135 additions and 127 deletions

View File

@@ -1136,7 +1136,7 @@ static char *fetch_out_desc_invstr(const tal_t *ctx, const char *buf,
if (!json_scan(ctx, buf, tok, "{bolt11:%}",
JSON_SCAN_TAL(ctx, json_strdup, &bolt))) {
struct bolt11 *bolt11;
u5 *sigdata;
const u5 *sigdata;
struct sha256 hash;
bool have_n;