core-lightning/lightningd/pay.h
Rusty Russell 4eb1233ccb lightningd: don't report spurious temporary_node_failure on local failures.
I noticed the following in logs for tests/test_connection.py::test_feerate_stress:

```
DEBUG 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-chan#1: Failing HTLC 18446744073709551615 due to peer death
DEBUG 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-chan#1: local_routing_failure: 8194 (WIRE_TEMPORARY_NODE_FAILURE)
```

This is because it reports the (transient) node_failure error, because
our channel_failure message is incomplete.  Fix this wart up.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-05-04 18:56:33 +09:30

39 lines
1.3 KiB
C

#ifndef LIGHTNING_LIGHTNINGD_PAY_H
#define LIGHTNING_LIGHTNINGD_PAY_H
#include "config.h"
#include <ccan/short_types/short_types.h>
#include <common/errcode.h>
struct htlc_out;
struct lightningd;
struct onionreply;
struct preimage;
struct sha256;
struct json_stream;
struct wallet_payment;
struct routing_failure;
void payment_succeeded(struct lightningd *ld, struct htlc_out *hout,
const struct preimage *rval);
/* failmsg_needs_update is if we actually wanted to temporary_channel_failure
* but we haven't got the update msg yet */
void payment_failed(struct lightningd *ld, const struct htlc_out *hout,
const char *localfail, const u8 *failmsg_needs_update);
/* Inform payment system to save the payment. */
void payment_store(struct lightningd *ld, struct wallet_payment *payment);
/* This json will be also used in 'sendpay_success' notifictaion. */
void json_add_payment_fields(struct json_stream *response,
const struct wallet_payment *t);
/* This json will be also used in 'sendpay_failure' notifictaion. */
void json_sendpay_fail_fields(struct json_stream *js,
const struct wallet_payment *t,
errcode_t pay_errcode,
const struct onionreply *onionreply,
const struct routing_failure *fail);
#endif /* LIGHTNING_LIGHTNINGD_PAY_H */