mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-07 14:29:33 +01:00
4be1868b8a
`wallet_payment_store` would free the `wallet_payment` instance which would then cause us to reload it from the DB. Instead of doing the store->free->load dance we now tell `wallet_payment_store` whether it should take ownership and leave it alone if not. Passing the payment around instead of referencing it through payment_hash and partid is a nice side-effect.
35 lines
1.1 KiB
C
35 lines
1.1 KiB
C
#ifndef LIGHTNING_LIGHTNINGD_PAY_H
|
|
#define LIGHTNING_LIGHTNINGD_PAY_H
|
|
#include "config.h"
|
|
#include <ccan/short_types/short_types.h>
|
|
|
|
struct htlc_out;
|
|
struct lightningd;
|
|
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);
|
|
|
|
void payment_failed(struct lightningd *ld, const struct htlc_out *hout,
|
|
const char *localfail);
|
|
|
|
/* 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,
|
|
int pay_errcode,
|
|
const u8 *onionreply,
|
|
const struct routing_failure *fail);
|
|
|
|
#endif /* LIGHTNING_LIGHTNINGD_PAY_H */
|