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

Function payment_notify_failure

plugins/libplugin-pay.c:2117–2135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2115}
2116
2117static void payment_notify_failure(struct payment *p, const char *error_message)
2118{
2119 struct json_stream *n;
2120
2121 n = plugin_notification_start_obs(p->plugin, "pay_failure");
2122 /* Fake up the old "payload" style, *and* the old unwrapped style */
2123 if (notification_deprecated_out_ok(p->plugin, "notification", "payload",
2124 "v25.09", "v26.09")) {
2125 json_add_string(n, "origin", "pay");
2126 json_object_start(n, "payload");
2127 payment_failure_notify_core(p, n, error_message);
2128 json_object_end(n);
2129 }
2130
2131 json_object_start(n, "pay_failure");
2132 payment_failure_notify_core(p, n, error_message);
2133 json_object_end(n);
2134 plugin_notification_end_obs(p->plugin, n);
2135}
2136
2137/* Code shared by selfpay fast-path: populate JSON output for successful
2138 * payment, and send pay_success notification. */

Callers 1

payment_finishedFunction · 0.85

Calls 7

json_object_startFunction · 0.85
json_object_endFunction · 0.85
json_add_stringFunction · 0.50

Tested by

no test coverage detected