mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +01:00
offers: import latest variant from draft.
In particular, this changes the name of a field in invoice_request: `payer_signature` becomes simply `signature`. So we allow both for now, and send the old one unless deprecated_apis is disabled. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -1192,11 +1192,14 @@ force_payer_secret(struct command *cmd,
|
||||
"Could not remarshall invreq %s", tal_hex(tmpctx, msg));
|
||||
|
||||
merkle_tlv(sent->invreq->fields, &merkle);
|
||||
sighash_from_merkle("invoice_request", "payer_signature", &merkle, &sha);
|
||||
if (deprecated_apis)
|
||||
sighash_from_merkle("invoice_request", "payer_signature", &merkle, &sha);
|
||||
else
|
||||
sighash_from_merkle("invoice_request", "signature", &merkle, &sha);
|
||||
|
||||
sent->invreq->payer_signature = tal(invreq, struct bip340sig);
|
||||
sent->invreq->signature = tal(invreq, struct bip340sig);
|
||||
if (!secp256k1_schnorrsig_sign(secp256k1_ctx,
|
||||
sent->invreq->payer_signature->u8,
|
||||
sent->invreq->signature->u8,
|
||||
sha.u.u8,
|
||||
&kp,
|
||||
NULL, NULL)) {
|
||||
|
||||
Reference in New Issue
Block a user