Skip to content

Commit

Permalink
don't enforce description_hash checking
Browse files Browse the repository at this point in the history
  • Loading branch information
fiatjaf authored and cdecker committed Nov 25, 2019
1 parent 6ed3201 commit 17bb862
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions common/bolt11.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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,
Expand Down

0 comments on commit 17bb862

Please sign in to comment.