2016-09-06 09:17:49 +02:00
|
|
|
#ifndef LIGHTNING_DAEMON_INVOICE_H
|
|
|
|
#define LIGHTNING_DAEMON_INVOICE_H
|
|
|
|
#include "config.h"
|
|
|
|
#include "peer.h"
|
|
|
|
|
|
|
|
struct lightningd_state;
|
|
|
|
|
|
|
|
struct invoice {
|
|
|
|
struct list_node list;
|
|
|
|
const char *label;
|
2016-09-06 09:17:49 +02:00
|
|
|
u64 msatoshi;
|
2016-09-06 09:17:49 +02:00
|
|
|
struct rval r;
|
|
|
|
struct sha256 rhash;
|
2016-09-06 09:17:49 +02:00
|
|
|
u64 paid_num;
|
2016-09-06 09:17:49 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#define INVOICE_MAX_LABEL_LEN 128
|
|
|
|
|
|
|
|
/* From database */
|
|
|
|
void invoice_add(struct lightningd_state *dstate,
|
|
|
|
const struct rval *r,
|
2016-09-06 09:17:49 +02:00
|
|
|
u64 msatoshi,
|
2016-09-06 09:17:49 +02:00
|
|
|
const char *label,
|
2016-09-06 09:17:49 +02:00
|
|
|
u64 complete);
|
2016-09-06 09:17:49 +02:00
|
|
|
|
2016-09-06 09:17:49 +02:00
|
|
|
void resolve_invoice(struct lightningd_state *dstate,
|
2016-09-06 09:17:49 +02:00
|
|
|
struct invoice *invoice);
|
|
|
|
|
|
|
|
struct invoice *find_unpaid(struct lightningd_state *dstate,
|
|
|
|
const struct sha256 *rhash);
|
2016-09-06 09:17:49 +02:00
|
|
|
|
|
|
|
#endif /* LIGHTNING_DAEMON_INVOICE_H */
|