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

Function listsendpays_done

plugins/bkpr/bookkeeper.c:1174–1212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1172}
1173
1174static struct command_result *
1175listsendpays_done(struct command *cmd,
1176 const char *method,
1177 const char *buf,
1178 const jsmntok_t *result,
1179 struct payment_hash_info *phinfo)
1180{
1181 size_t i;
1182 const jsmntok_t *pays_arr_tok, *pays_tok;
1183 const char *desc;
1184 struct bkpr *bkpr = bkpr_of(cmd->plugin);
1185
1186 pays_arr_tok = json_get_member(buf, result, "payments");
1187 assert(pays_arr_tok->type == JSMN_ARRAY);
1188
1189 /* Did we find a matching entry? */
1190 desc = NULL;
1191 json_for_each_arr(i, pays_tok, pays_arr_tok) {
1192 char *err;
1193
1194 desc = fetch_out_desc_invstr(cmd, buf, pays_tok, &err);
1195 if (desc || err) {
1196 if (err)
1197 plugin_log(cmd->plugin,
1198 LOG_BROKEN, "%s", err);
1199 break;
1200 }
1201 }
1202
1203 if (desc) {
1204 add_payment_hash_description(cmd, bkpr, &phinfo->payment_hash, desc);
1205 } else
1206 plugin_log(cmd->plugin, LOG_DBG,
1207 "listpays: bolt11/bolt12 not found:"
1208 "(%.*s)",
1209 result->end - result->start, buf + result->start);
1210
1211 return rinfo_one_done(cmd, phinfo->rinfo);
1212}
1213
1214static struct command_result *lookup_invoice_desc(struct command *cmd,
1215 struct amount_msat credit,

Callers

nothing calls this directly

Calls 6

json_get_memberFunction · 0.85
fetch_out_desc_invstrFunction · 0.85
rinfo_one_doneFunction · 0.85
bkpr_ofFunction · 0.70
plugin_logFunction · 0.50

Tested by

no test coverage detected