| 207 | } |
| 208 | |
| 209 | static struct command_result *create_invoicereq(struct command *cmd, |
| 210 | struct invreq *ir) |
| 211 | { |
| 212 | struct out_req *req; |
| 213 | |
| 214 | /* Now, write invoice to db (returns the signed version) */ |
| 215 | req = jsonrpc_request_start(cmd->plugin, cmd, "createinvoice", |
| 216 | createinvoice_done, createinvoice_error, ir); |
| 217 | |
| 218 | json_add_string(req->js, "invstring", invoice_encode(tmpctx, ir->inv)); |
| 219 | json_add_preimage(req->js, "preimage", &ir->preimage); |
| 220 | json_add_label(req->js, ir->inv->offer_id, ir->inv->payer_key, |
| 221 | ir->inv->recurrence_counter |
| 222 | ? *ir->inv->recurrence_counter : 0); |
| 223 | return send_outreq(cmd->plugin, req); |
| 224 | } |
| 225 | |
| 226 | static struct command_result *check_period(struct command *cmd, |
| 227 | struct invreq *ir, |
no test coverage detected