BOLT #12: * - MUST reject the invoice request if `signature` is not correct as detailed in * [Signature Calculation](#signature-calculation) using the * `invreq_payer_id`. *... * - MUST reject the invoice if `signature` is not a valid signature using * `invoice_node_id` as described in [Signature Calculation](#signature-calculation). */
| 639 | * `invoice_node_id` as described in [Signature Calculation](#signature-calculation). |
| 640 | */ |
| 641 | static bool check_payer_sig(struct command *cmd, |
| 642 | const struct tlv_invoice_request *invreq, |
| 643 | const struct pubkey *payer_key, |
| 644 | const struct bip340sig *sig) |
| 645 | { |
| 646 | struct sha256 merkle, sighash; |
| 647 | merkle_tlv(invreq->fields, &merkle); |
| 648 | sighash_from_merkle("invoice_request", "signature", &merkle, &sighash); |
| 649 | |
| 650 | return check_schnorr_sig(&sighash, &payer_key->pubkey, sig); |
| 651 | } |
| 652 | |
| 653 | static struct command_result *invreq_amount_by_quantity(struct command *cmd, |
| 654 | const struct invreq *ir, |
no test coverage detected