| 392 | } |
| 393 | |
| 394 | static struct per_variant *get_listsendpays_variant(const char *buf, |
| 395 | const jsmntok_t *t, |
| 396 | struct per_subsystem *subsystem, |
| 397 | u64 *timestamp) |
| 398 | { |
| 399 | struct per_variant *variant; |
| 400 | const jsmntok_t *time, *status = json_get_member(buf, t, "status"); |
| 401 | |
| 402 | if (json_tok_streq(buf, status, "failed")) { |
| 403 | variant = &subsystem->variants[FAILURE]; |
| 404 | } else if (json_tok_streq(buf, status, "complete")) { |
| 405 | variant = &subsystem->variants[SUCCESS]; |
| 406 | } else { |
| 407 | return NULL; |
| 408 | } |
| 409 | |
| 410 | time = json_get_member(buf, t, "created_at"); |
| 411 | if (!json_to_u64(buf, time, timestamp)) { |
| 412 | plugin_err(plugin, "Bad created_at '%.*s'", |
| 413 | json_tok_full_len(time), |
| 414 | json_tok_full(buf, time)); |
| 415 | } |
| 416 | return variant; |
| 417 | } |
| 418 | |
| 419 | static struct per_variant *get_listforwards_variant(const char *buf, |
| 420 | const jsmntok_t *t, |
nothing calls this directly
no test coverage detected