common: fix bolt11 parsing of unknown f versions.

As tested in next test.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2020-02-03 10:59:42 +10:30 committed by Christian Decker
parent d8e933aac7
commit 77c867d95f

View File

@ -390,9 +390,14 @@ static char *decode_f(struct bolt11 *b11,
fallback = scriptpubkey_witness_raw(b11, version,
f, tal_count(f));
tal_free(f);
} else
} else {
/* Restore version for unknown field! */
(*data)--;
(*data_len)++;
data_length++;
return unknown_field(b11, hu5, data, data_len, 'f',
data_length);
}
if (b11->fallbacks == NULL)
b11->fallbacks = tal_arr(b11, const u8 *, 1);