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

Function outgoing_notify_start

plugins/xpay/xpay.c:632–651  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

630}
631
632static void outgoing_notify_start(const struct attempt *attempt)
633{
634 struct json_stream *js = plugin_notification_start(NULL, "pay_part_start");
635 json_add_attempt_fields(js, attempt);
636 json_add_amount_msat(js, "total_payment_msat", attempt->payment->amount);
637 json_add_amount_msat(js, "attempt_msat", attempt->amount);
638 json_array_start(js, "hops");
639 for (size_t i = 0; i < tal_count(attempt->hops); i++) {
640 const struct hop *hop = &attempt->hops[i];
641 json_object_start(js, NULL);
642 json_add_pubkey(js, "next_node", &hop->next_node);
643 json_add_short_channel_id(js, "short_channel_id", hop->scidd.scid);
644 json_add_u32(js, "direction", hop->scidd.dir);
645 json_add_amount_msat(js, "channel_in_msat", hop->amount_in);
646 json_add_amount_msat(js, "channel_out_msat", hop->amount_out);
647 json_object_end(js);
648 }
649 json_array_end(js);
650 plugin_notification_end(attempt->payment->plugin, js);
651}
652
653static void outgoing_notify_success(const struct attempt *attempt)
654{

Callers 1

do_injectFunction · 0.85

Calls 11

json_add_attempt_fieldsFunction · 0.85
json_add_amount_msatFunction · 0.85
json_array_startFunction · 0.85
json_object_startFunction · 0.85
json_add_pubkeyFunction · 0.85
json_add_u32Function · 0.85
json_object_endFunction · 0.85
json_array_endFunction · 0.85
plugin_notification_endFunction · 0.85

Tested by

no test coverage detected