| 8 | #include <lightningd/peer_htlcs.h> |
| 9 | |
| 10 | static struct incoming_payment *new_inpay(const tal_t *ctx, |
| 11 | struct logger *log, |
| 12 | struct amount_msat msat, |
| 13 | void (*fail)(void *, const u8 *), |
| 14 | void (*succeeded)(void *, |
| 15 | const struct preimage *), |
| 16 | void *arg) |
| 17 | { |
| 18 | struct incoming_payment *inpay = tal(ctx, struct incoming_payment); |
| 19 | inpay->log = log; |
| 20 | inpay->msat = msat; |
| 21 | inpay->fail = fail; |
| 22 | inpay->succeeded = succeeded; |
| 23 | inpay->arg = arg; |
| 24 | return inpay; |
| 25 | } |
| 26 | |
| 27 | /* If an HTLC times out, we need to free entire set, since we could be |
| 28 | * processing it in invoice.c right now. */ |