Browse Source

don't enforce description_hash checking

travis-debug
fiatjaf 5 years ago
committed by Christian Decker
parent
commit
17bb862cfe
  1. 5
      common/bolt11.c

5
common/bolt11.c

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

Loading…
Cancel
Save