mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
offers: include the payer_note field in the invoice if it's in the request.
And list it in bolt12-cli decode, and the `decode` command. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -819,6 +819,14 @@ static struct command_result *listoffers_done(struct command *cmd,
|
||||
ir->inv->payer_info
|
||||
= tal_dup_talarr(ir->inv, u8, ir->invreq->payer_info);
|
||||
|
||||
/* BOLT-offers #12:
|
||||
* - MUST set (or not set) `payer_note` exactly as the invoice_request
|
||||
* did, or MUST not set it.
|
||||
*/
|
||||
/* i.e. we don't have to do anything, but we do. */
|
||||
ir->inv->payer_note
|
||||
= tal_dup_talarr(ir->inv, char, ir->invreq->payer_note);
|
||||
|
||||
randombytes_buf(&ir->preimage, sizeof(ir->preimage));
|
||||
ir->inv->payment_hash = tal(ir->inv, struct sha256);
|
||||
sha256(ir->inv->payment_hash, &ir->preimage, sizeof(ir->preimage));
|
||||
|
||||
Reference in New Issue
Block a user