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

Function payment_notify_failure

plugins/libplugin-pay.c:1870–1885  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1868}
1869
1870static void payment_notify_failure(struct payment *p, const char *error_message)
1871{
1872 struct payment *root = payment_root(p);
1873 struct json_stream *n;
1874
1875 n = plugin_notification_start(p->plugin, "pay_failure");
1876 json_add_sha256(n, "payment_hash", p->payment_hash);
1877 if (root->invstring != NULL)
1878 json_add_string(n, "bolt11", root->invstring);
1879
1880 json_object_start(n, "error");
1881 json_add_string(n, "message", error_message);
1882 json_object_end(n); /* .error */
1883
1884 plugin_notification_end(p->plugin, n);
1885}
1886
1887/* This function is called whenever a payment ends up in a final state, or all
1888 * leafs in the subtree rooted in the payment are all in a final state. It is

Callers 1

payment_finishedFunction · 0.85

Calls 7

payment_rootFunction · 0.85
plugin_notification_endFunction · 0.70
json_add_sha256Function · 0.50
json_add_stringFunction · 0.50
json_object_startFunction · 0.50
json_object_endFunction · 0.50

Tested by

no test coverage detected