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

Function payment_notify_failure

plugins/libplugin-pay.c:2133–2151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2131}
2132
2133static void payment_notify_failure(struct payment *p, const char *error_message)
2134{
2135 struct json_stream *n;
2136
2137 n = plugin_notification_start_obs(p->plugin, "pay_failure");
2138 /* Fake up the old "payload" style, *and* the old unwrapped style */
2139 if (notification_deprecated_out_ok(p->plugin, "notification", "payload",
2140 "v25.09", "v26.09")) {
2141 json_add_string(n, "origin", "pay");
2142 json_object_start(n, "payload");
2143 payment_failure_notify_core(p, n, error_message);
2144 json_object_end(n);
2145 }
2146
2147 json_object_start(n, "pay_failure");
2148 payment_failure_notify_core(p, n, error_message);
2149 json_object_end(n);
2150 plugin_notification_end_obs(p->plugin, n);
2151}
2152
2153/* Code shared by selfpay fast-path: populate JSON output for successful
2154 * 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