| 234 | } |
| 235 | |
| 236 | static struct command_result *create_invoicereq(struct command *cmd, |
| 237 | struct invreq *ir) |
| 238 | { |
| 239 | struct out_req *req; |
| 240 | |
| 241 | /* FIXME: We should add a real blinded path, and we *need to* |
| 242 | * if we don't have public channels! */ |
| 243 | |
| 244 | /* Now, write invoice to db (returns the signed version) */ |
| 245 | req = jsonrpc_request_start(cmd, "createinvoice", |
| 246 | createinvoice_done, createinvoice_error, ir); |
| 247 | |
| 248 | json_add_string(req->js, "invstring", invoice_encode(tmpctx, ir->inv)); |
| 249 | json_add_preimage(req->js, "preimage", &ir->preimage); |
| 250 | json_add_label(req->js, &ir->offer_id, ir->inv->invreq_payer_id, |
| 251 | ir->inv->invreq_recurrence_counter |
| 252 | ? *ir->inv->invreq_recurrence_counter : 0); |
| 253 | return send_outreq(req); |
| 254 | } |
| 255 | |
| 256 | /* FIXME: Allow multihop! */ |
| 257 | /* FIXME: And add padding! */ |
no test coverage detected