| 1414 | } |
| 1415 | |
| 1416 | static struct command_result *sign_invoice(struct command *cmd, |
| 1417 | struct sent *sent) |
| 1418 | { |
| 1419 | struct out_req *req; |
| 1420 | |
| 1421 | /* Get invoice signature and put in db so we can receive payment */ |
| 1422 | req = jsonrpc_request_start(cmd->plugin, cmd, "createinvoice", |
| 1423 | &createinvoice_done, |
| 1424 | &forward_error, |
| 1425 | sent); |
| 1426 | json_add_string(req->js, "invstring", invoice_encode(tmpctx, sent->inv)); |
| 1427 | json_add_preimage(req->js, "preimage", &sent->inv_preimage); |
| 1428 | json_add_escaped_string(req->js, "label", sent->inv_label); |
| 1429 | return send_outreq(cmd->plugin, req); |
| 1430 | } |
| 1431 | |
| 1432 | static bool json_to_bip340sig(const char *buffer, const jsmntok_t *tok, |
| 1433 | struct bip340sig *sig) |
no test coverage detected