| 1868 | } |
| 1869 | |
| 1870 | static 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 |
no test coverage detected