| 190 | } |
| 191 | |
| 192 | static struct command_result *createinvoice_error(struct command *cmd, |
| 193 | const char *buf, |
| 194 | const jsmntok_t *err, |
| 195 | struct invreq *ir) |
| 196 | { |
| 197 | u32 code; |
| 198 | |
| 199 | /* If it already exists, we can reuse its bolt12 directly. */ |
| 200 | if (json_scan(tmpctx, buf, err, |
| 201 | "{code:%}", JSON_SCAN(json_to_u32, &code)) == NULL |
| 202 | && code == INVOICE_LABEL_ALREADY_EXISTS) { |
| 203 | return createinvoice_done(cmd, buf, |
| 204 | json_get_member(buf, err, "data"), ir); |
| 205 | } |
| 206 | return error(cmd, buf, err, ir); |
| 207 | } |
| 208 | |
| 209 | static struct command_result *create_invoicereq(struct command *cmd, |
| 210 | struct invreq *ir) |
nothing calls this directly
no test coverage detected