don't enforce description_hash checking

This commit is contained in:
fiatjaf 2019-11-24 09:22:01 -03:00 committed by Christian Decker
parent 6ed320189e
commit 17bb862cfe

View File

@ -741,7 +741,7 @@ struct bolt11 *bolt11_decode(const tal_t *ctx, const char *str,
if (!have_p)
return decode_fail(b11, fail, "No valid 'p' field found");
if (have_h) {
if (have_h && description) {
struct sha256 sha;
/* BOLT #11:
@ -750,9 +750,6 @@ struct bolt11 *bolt11_decode(const tal_t *ctx, const char *str,
* in the `h` field exactly matches the hashed
* description.
*/
if (!description)
return decode_fail(b11, fail,
"h: no description to check");
sha256(&sha, description, strlen(description));
if (!sha256_eq(b11->description_hash, &sha))
return decode_fail(b11, fail,