MCPcopy Create free account
hub / github.com/ElementsProject/lightning / get_listsendpays_variant

Function get_listsendpays_variant

plugins/autoclean.c:394–417  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

392}
393
394static 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
419static struct per_variant *get_listforwards_variant(const char *buf,
420 const jsmntok_t *t,

Callers

nothing calls this directly

Calls 6

json_get_memberFunction · 0.85
json_tok_streqFunction · 0.85
plugin_errFunction · 0.70
json_to_u64Function · 0.50
json_tok_full_lenFunction · 0.50
json_tok_fullFunction · 0.50

Tested by

no test coverage detected