Skip to content

Commit

Permalink
invoice: Add description_hash
Browse files Browse the repository at this point in the history
  • Loading branch information
jsarenik committed Mar 24, 2022
1 parent 560b090 commit a14c8d9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lightningd/invoice.c
Original file line number Diff line number Diff line change
Expand Up @@ -1138,6 +1138,7 @@ static struct command_result *json_invoice(struct command *cmd,
#if DEVELOPER
const jsmntok_t *routes;
#endif
struct sha256 desc_hash;

info = tal(cmd, struct invoice_info);
info->cmd = cmd;
Expand Down Expand Up @@ -1207,7 +1208,7 @@ static struct command_result *json_invoice(struct command *cmd,
info->b11->min_final_cltv_expiry = *cltv;
info->b11->expiry = *expiry;
info->b11->description = tal_steal(info->b11, desc_val);
info->b11->description_hash = NULL;
info->b11->description_hash = sha256(&desc_hash, desc_val, sizeof(*desc_val));
info->b11->payment_secret = tal_dup(info->b11, struct secret,
&payment_secret);
info->b11->features = tal_dup_talarr(info->b11, u8,
Expand Down

0 comments on commit a14c8d9

Please sign in to comment.