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

Function invoice_payment_serialize

lightningd/invoice.c:210–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

208#endif
209
210static void
211invoice_payment_serialize(struct invoice_payment_hook_payload *payload,
212 struct json_stream *stream,
213 struct plugin *plugin)
214{
215 json_object_start(stream, "payment");
216 json_add_escaped_string(stream, "label", payload->label);
217 json_add_preimage(stream, "preimage", &payload->preimage);
218 json_add_string(stream, "msat",
219 type_to_string(tmpctx, struct amount_msat,
220 &payload->msat));
221#ifdef DEVELOPER
222 invoice_payment_add_tlvs(stream, payload->set);
223#endif
224 json_object_end(stream); /* .payment */
225}
226
227/* Set times out or HTLC deleted? Remove set ptr from payload so we
228 * know to ignore plugin return */

Callers

nothing calls this directly

Calls 7

invoice_payment_add_tlvsFunction · 0.85
json_object_startFunction · 0.50
json_add_escaped_stringFunction · 0.50
json_add_preimageFunction · 0.50
json_add_stringFunction · 0.50
type_to_stringClass · 0.50
json_object_endFunction · 0.50

Tested by

no test coverage detected