mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
wallet/invoice: remove indirection.
We can expose the dbid, rather than pretending we have some "struct invoice" which is actually just the dbid. And don't have a pile of "wallet_" wrappers for redirection. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#include <lightningd/plugin_hook.h>
|
||||
#include <lightningd/routehint.h>
|
||||
#include <sodium/randombytes.h>
|
||||
#include <wallet/invoices.h>
|
||||
#include <wire/wire_sync.h>
|
||||
|
||||
const char *invoice_status_str(enum invoice_status state)
|
||||
@@ -89,13 +90,12 @@ static void json_add_invoice(struct json_stream *response,
|
||||
json_object_end(response);
|
||||
}
|
||||
|
||||
static struct command_result *tell_waiter(struct command *cmd,
|
||||
const struct invoice *inv)
|
||||
static struct command_result *tell_waiter(struct command *cmd, u64 inv_dbid)
|
||||
{
|
||||
struct json_stream *response;
|
||||
const struct invoice_details *details;
|
||||
|
||||
details = wallet_invoice_details(cmd, cmd->ld->wallet, *inv);
|
||||
details = invoices_get_details(cmd, cmd->ld->wallet->invoices, inv_dbid);
|
||||
if (details->state == PAID) {
|
||||
response = json_stream_success(cmd);
|
||||
json_add_invoice_fields(response, details);
|
||||
@@ -114,10 +114,10 @@ static void tell_waiter_deleted(struct command *cmd)
|
||||
was_pending(command_fail(cmd, LIGHTNINGD,
|
||||
"Invoice deleted during wait"));
|
||||
}
|
||||
static void wait_on_invoice(const struct invoice *invoice, void *cmd)
|
||||
static void wait_on_invoice(const u64 *inv_dbid, void *cmd)
|
||||
{
|
||||
if (invoice)
|
||||
tell_waiter((struct command *) cmd, invoice);
|
||||
if (inv_dbid)
|
||||
tell_waiter((struct command *) cmd, *inv_dbid);
|
||||
else
|
||||
tell_waiter_deleted((struct command *) cmd);
|
||||
}
|
||||
@@ -299,7 +299,7 @@ static const u8 *hook_gives_failmsg(const tal_t *ctx,
|
||||
static void
|
||||
invoice_payment_hooks_done(struct invoice_payment_hook_payload *payload STEALS)
|
||||
{
|
||||
struct invoice invoice;
|
||||
u64 inv_dbid;
|
||||
struct lightningd *ld = payload->ld;
|
||||
|
||||
tal_del_destructor2(payload->set, invoice_payload_remove_set, payload);
|
||||
@@ -308,14 +308,14 @@ invoice_payment_hooks_done(struct invoice_payment_hook_payload *payload STEALS)
|
||||
|
||||
/* If invoice gets paid meanwhile (plugin responds out-of-order?) then
|
||||
* we can also fail */
|
||||
if (!wallet_invoice_find_by_label(ld->wallet, &invoice, payload->label)) {
|
||||
if (!invoices_find_by_label(ld->wallet->invoices, &inv_dbid, payload->label)) {
|
||||
htlc_set_fail(payload->set, take(failmsg_incorrect_or_unknown(
|
||||
NULL, ld, payload->set->htlcs[0])));
|
||||
return;
|
||||
}
|
||||
|
||||
/* Paid or expired in the meantime. */
|
||||
if (!wallet_invoice_resolve(ld->wallet, invoice, payload->msat)) {
|
||||
if (!invoices_resolve(ld->wallet->invoices, inv_dbid, payload->msat)) {
|
||||
htlc_set_fail(payload->set, take(failmsg_incorrect_or_unknown(
|
||||
NULL, ld, payload->set->htlcs[0])));
|
||||
return;
|
||||
@@ -369,7 +369,7 @@ invoice_check_payment(const tal_t *ctx,
|
||||
const struct amount_msat msat,
|
||||
const struct secret *payment_secret)
|
||||
{
|
||||
struct invoice invoice;
|
||||
u64 inv_dbid;
|
||||
const struct invoice_details *details;
|
||||
|
||||
/* BOLT #4:
|
||||
@@ -381,17 +381,17 @@ invoice_check_payment(const tal_t *ctx,
|
||||
* - MUST fail the HTLC.
|
||||
* - MUST return an `incorrect_or_unknown_payment_details` error.
|
||||
*/
|
||||
if (!wallet_invoice_find_unpaid(ld->wallet, &invoice, payment_hash)) {
|
||||
if (!invoices_find_unpaid(ld->wallet->invoices, &inv_dbid, payment_hash)) {
|
||||
log_debug(ld->log, "Unknown paid invoice %s",
|
||||
type_to_string(tmpctx, struct sha256, payment_hash));
|
||||
if (wallet_invoice_find_by_rhash(ld->wallet, &invoice, payment_hash)) {
|
||||
if (invoices_find_by_rhash(ld->wallet->invoices, &inv_dbid, payment_hash)) {
|
||||
log_debug(ld->log, "ALREADY paid invoice %s",
|
||||
type_to_string(tmpctx, struct sha256, payment_hash));
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
details = wallet_invoice_details(ctx, ld->wallet, invoice);
|
||||
details = invoices_get_details(ctx, ld->wallet->invoices, inv_dbid);
|
||||
|
||||
/* BOLT #4:
|
||||
* - if the `payment_secret` doesn't match the expected value for that
|
||||
@@ -839,7 +839,7 @@ invoice_complete(struct invoice_info *info,
|
||||
bool warning_private_unused)
|
||||
{
|
||||
struct json_stream *response;
|
||||
struct invoice invoice;
|
||||
u64 inv_dbid;
|
||||
char *b11enc;
|
||||
const struct invoice_details *details;
|
||||
struct secret payment_secret;
|
||||
@@ -849,31 +849,31 @@ invoice_complete(struct invoice_info *info,
|
||||
hsm_sign_b11, info->cmd->ld);
|
||||
|
||||
/* Check duplicate preimage (unlikely unless they specified it!) */
|
||||
if (wallet_invoice_find_by_rhash(wallet,
|
||||
&invoice, &info->b11->payment_hash)) {
|
||||
if (invoices_find_by_rhash(wallet->invoices,
|
||||
&inv_dbid, &info->b11->payment_hash)) {
|
||||
return command_fail(info->cmd,
|
||||
INVOICE_PREIMAGE_ALREADY_EXISTS,
|
||||
"preimage already used");
|
||||
}
|
||||
|
||||
if (!wallet_invoice_create(wallet,
|
||||
&invoice,
|
||||
info->b11->msat,
|
||||
info->label,
|
||||
info->b11->expiry,
|
||||
b11enc,
|
||||
info->b11->description,
|
||||
info->b11->features,
|
||||
&info->payment_preimage,
|
||||
&info->b11->payment_hash,
|
||||
NULL)) {
|
||||
if (!invoices_create(wallet->invoices,
|
||||
&inv_dbid,
|
||||
info->b11->msat,
|
||||
info->label,
|
||||
info->b11->expiry,
|
||||
b11enc,
|
||||
info->b11->description,
|
||||
info->b11->features,
|
||||
&info->payment_preimage,
|
||||
&info->b11->payment_hash,
|
||||
NULL)) {
|
||||
return command_fail(info->cmd, INVOICE_LABEL_ALREADY_EXISTS,
|
||||
"Duplicate label '%s'",
|
||||
info->label->s);
|
||||
}
|
||||
|
||||
/* Get details */
|
||||
details = wallet_invoice_details(info, wallet, invoice);
|
||||
details = invoices_get_details(info, wallet->invoices, inv_dbid);
|
||||
|
||||
response = json_stream_success(info->cmd);
|
||||
json_add_sha256(response, "payment_hash", &details->rhash);
|
||||
@@ -1090,6 +1090,7 @@ static struct command_result *json_invoice(struct command *cmd,
|
||||
struct jsonrpc_request *req;
|
||||
struct plugin *plugin;
|
||||
bool *hashonly;
|
||||
const size_t inv_max_label_len = 128;
|
||||
#if DEVELOPER
|
||||
const jsmntok_t *routes;
|
||||
#endif
|
||||
@@ -1115,10 +1116,9 @@ static struct command_result *json_invoice(struct command *cmd,
|
||||
NULL))
|
||||
return command_param_failed();
|
||||
|
||||
if (strlen(info->label->s) > INVOICE_MAX_LABEL_LEN) {
|
||||
if (strlen(info->label->s) > inv_max_label_len) {
|
||||
return command_fail(cmd, JSONRPC2_INVALID_PARAMS,
|
||||
"Label '%s' over %u bytes", info->label->s,
|
||||
INVOICE_MAX_LABEL_LEN);
|
||||
"Label '%s' over %zu bytes", info->label->s, inv_max_label_len);
|
||||
}
|
||||
|
||||
if (strlen(desc_val) > BOLT11_FIELD_BYTE_LIMIT && !*hashonly) {
|
||||
@@ -1225,27 +1225,27 @@ static void json_add_invoices(struct json_stream *response,
|
||||
{
|
||||
struct invoice_iterator it;
|
||||
const struct invoice_details *details;
|
||||
struct invoice invoice;
|
||||
u64 inv_dbid;
|
||||
|
||||
/* Don't iterate entire db if we're just after one. */
|
||||
if (label) {
|
||||
if (wallet_invoice_find_by_label(wallet, &invoice, label)) {
|
||||
if (invoices_find_by_label(wallet->invoices, &inv_dbid, label)) {
|
||||
details =
|
||||
wallet_invoice_details(tmpctx, wallet, invoice);
|
||||
invoices_get_details(tmpctx, wallet->invoices, inv_dbid);
|
||||
json_add_invoice(response, NULL, details);
|
||||
}
|
||||
} else if (payment_hash != NULL) {
|
||||
if (wallet_invoice_find_by_rhash(wallet, &invoice,
|
||||
if (invoices_find_by_rhash(wallet->invoices, &inv_dbid,
|
||||
payment_hash)) {
|
||||
details =
|
||||
wallet_invoice_details(tmpctx, wallet, invoice);
|
||||
invoices_get_details(tmpctx, wallet->invoices, inv_dbid);
|
||||
json_add_invoice(response, NULL, details);
|
||||
}
|
||||
} else {
|
||||
memset(&it, 0, sizeof(it));
|
||||
while (wallet_invoice_iterate(wallet, &it)) {
|
||||
details = wallet_invoice_iterator_deref(response,
|
||||
wallet, &it);
|
||||
while (invoices_iterate(wallet->invoices, &it)) {
|
||||
details = invoices_iterator_deref(response,
|
||||
wallet->invoices, &it);
|
||||
/* FIXME: db can filter this better! */
|
||||
if (local_offer_id) {
|
||||
if (!details->local_offer_id
|
||||
@@ -1328,7 +1328,7 @@ static struct command_result *json_delinvoice(struct command *cmd,
|
||||
const jsmntok_t *obj UNNEEDED,
|
||||
const jsmntok_t *params)
|
||||
{
|
||||
struct invoice i;
|
||||
u64 inv_dbid;
|
||||
struct invoice_details *details;
|
||||
struct json_stream *response;
|
||||
const char *status, *actual_status;
|
||||
@@ -1343,11 +1343,11 @@ static struct command_result *json_delinvoice(struct command *cmd,
|
||||
NULL))
|
||||
return command_param_failed();
|
||||
|
||||
if (!wallet_invoice_find_by_label(wallet, &i, label)) {
|
||||
if (!invoices_find_by_label(wallet->invoices, &inv_dbid, label)) {
|
||||
return command_fail(cmd, INVOICE_NOT_FOUND, "Unknown invoice");
|
||||
}
|
||||
|
||||
details = wallet_invoice_details(cmd, cmd->ld->wallet, i);
|
||||
details = invoices_get_details(cmd, cmd->ld->wallet->invoices, inv_dbid);
|
||||
|
||||
/* This is time-sensitive, so only call once; otherwise error msg
|
||||
* might not make sense if it changed! */
|
||||
@@ -1369,19 +1369,19 @@ static struct command_result *json_delinvoice(struct command *cmd,
|
||||
return command_fail(cmd, INVOICE_NO_DESCRIPTION,
|
||||
"Invoice description already removed");
|
||||
|
||||
if (!wallet_invoice_delete_description(wallet, i)) {
|
||||
if (!invoices_delete_description(wallet->invoices, inv_dbid)) {
|
||||
log_broken(cmd->ld->log,
|
||||
"Error attempting to delete description of invoice %"PRIu64,
|
||||
i.id);
|
||||
inv_dbid);
|
||||
/* FIXME: allocate a generic DATABASE_ERROR code. */
|
||||
return command_fail(cmd, LIGHTNINGD, "Database error");
|
||||
}
|
||||
details->description = tal_free(details->description);
|
||||
} else {
|
||||
if (!wallet_invoice_delete(wallet, i)) {
|
||||
if (!invoices_delete(wallet->invoices, inv_dbid)) {
|
||||
log_broken(cmd->ld->log,
|
||||
"Error attempting to remove invoice %"PRIu64,
|
||||
i.id);
|
||||
inv_dbid);
|
||||
/* FIXME: allocate a generic DATABASE_ERROR code. */
|
||||
return command_fail(cmd, LIGHTNINGD, "Database error");
|
||||
}
|
||||
@@ -1413,7 +1413,7 @@ static struct command_result *json_delexpiredinvoice(struct command *cmd,
|
||||
NULL))
|
||||
return command_param_failed();
|
||||
|
||||
wallet_invoice_delete_expired(cmd->ld->wallet, *maxexpirytime);
|
||||
invoices_delete_expired(cmd->ld->wallet->invoices, *maxexpirytime);
|
||||
|
||||
return command_success(cmd, json_stream_success(cmd));
|
||||
}
|
||||
@@ -1457,8 +1457,8 @@ static struct command_result *json_waitanyinvoice(struct command *cmd,
|
||||
fixme_ignore(command_still_pending(cmd));
|
||||
|
||||
/* Find next paid invoice. */
|
||||
wallet_invoice_waitany(cmd, wallet, *pay_index,
|
||||
&wait_on_invoice, (void*) cmd);
|
||||
invoices_waitany(cmd, wallet->invoices, *pay_index,
|
||||
&wait_on_invoice, (void*) cmd);
|
||||
|
||||
return command_its_complicated("wallet_invoice_waitany might complete"
|
||||
" immediately, but we also call it as a"
|
||||
@@ -1486,7 +1486,7 @@ static struct command_result *json_waitinvoice(struct command *cmd,
|
||||
const jsmntok_t *obj UNNEEDED,
|
||||
const jsmntok_t *params)
|
||||
{
|
||||
struct invoice i;
|
||||
u64 inv_dbid;
|
||||
const struct invoice_details *details;
|
||||
struct wallet *wallet = cmd->ld->wallet;
|
||||
struct json_escape *label;
|
||||
@@ -1496,19 +1496,19 @@ static struct command_result *json_waitinvoice(struct command *cmd,
|
||||
NULL))
|
||||
return command_param_failed();
|
||||
|
||||
if (!wallet_invoice_find_by_label(wallet, &i, label)) {
|
||||
if (!invoices_find_by_label(wallet->invoices, &inv_dbid, label)) {
|
||||
return command_fail(cmd, LIGHTNINGD, "Label not found");
|
||||
}
|
||||
details = wallet_invoice_details(cmd, cmd->ld->wallet, i);
|
||||
details = invoices_get_details(cmd, cmd->ld->wallet->invoices, inv_dbid);
|
||||
|
||||
/* If paid or expired return immediately */
|
||||
if (details->state == PAID || details->state == EXPIRED) {
|
||||
return tell_waiter(cmd, &i);
|
||||
return tell_waiter(cmd, inv_dbid);
|
||||
} else {
|
||||
/* There is an unpaid one matching, let's wait... */
|
||||
fixme_ignore(command_still_pending(cmd));
|
||||
wallet_invoice_waitone(cmd, wallet, i,
|
||||
&wait_on_invoice, (void *) cmd);
|
||||
invoices_waitone(cmd, wallet->invoices, inv_dbid,
|
||||
&wait_on_invoice, (void *) cmd);
|
||||
return command_its_complicated("wallet_invoice_waitone might"
|
||||
" complete immediately");
|
||||
}
|
||||
@@ -1563,17 +1563,17 @@ static struct command_result *fail_exists(struct command *cmd,
|
||||
const struct json_escape *label)
|
||||
{
|
||||
struct json_stream *data;
|
||||
struct invoice invoice;
|
||||
u64 inv_dbid;
|
||||
struct wallet *wallet = cmd->ld->wallet;
|
||||
|
||||
data = json_stream_fail(cmd, INVOICE_LABEL_ALREADY_EXISTS,
|
||||
"Duplicate label");
|
||||
if (!wallet_invoice_find_by_label(wallet, &invoice, label))
|
||||
if (!invoices_find_by_label(wallet->invoices, &inv_dbid, label))
|
||||
fatal("Duplicate invoice %s not found any more?",
|
||||
label->s);
|
||||
|
||||
json_add_invoice_fields(data,
|
||||
wallet_invoice_details(cmd, wallet, invoice));
|
||||
invoices_get_details(cmd, wallet->invoices, inv_dbid));
|
||||
json_object_end(data);
|
||||
|
||||
return command_failed(cmd, data);
|
||||
@@ -1644,7 +1644,7 @@ static struct command_result *json_createinvoice(struct command *cmd,
|
||||
const char *invstring;
|
||||
struct json_escape *label;
|
||||
struct preimage *preimage;
|
||||
struct invoice invoice;
|
||||
u64 inv_dbid;
|
||||
struct sha256 payment_hash;
|
||||
struct json_stream *response;
|
||||
struct bolt11 *b11;
|
||||
@@ -1681,17 +1681,17 @@ static struct command_result *json_createinvoice(struct command *cmd,
|
||||
return command_fail(cmd, JSONRPC2_INVALID_PARAMS,
|
||||
"Incorrect preimage");
|
||||
|
||||
if (!wallet_invoice_create(cmd->ld->wallet,
|
||||
&invoice,
|
||||
b11->msat,
|
||||
label,
|
||||
b11->expiry,
|
||||
b11enc,
|
||||
b11->description,
|
||||
b11->features,
|
||||
preimage,
|
||||
&payment_hash,
|
||||
NULL))
|
||||
if (!invoices_create(cmd->ld->wallet->invoices,
|
||||
&inv_dbid,
|
||||
b11->msat,
|
||||
label,
|
||||
b11->expiry,
|
||||
b11enc,
|
||||
b11->description,
|
||||
b11->features,
|
||||
preimage,
|
||||
&payment_hash,
|
||||
NULL))
|
||||
return fail_exists(cmd, label);
|
||||
|
||||
notify_invoice_creation(cmd->ld, b11->msat, *preimage, label);
|
||||
@@ -1775,17 +1775,17 @@ static struct command_result *json_createinvoice(struct command *cmd,
|
||||
inv->offer_description,
|
||||
tal_bytelen(inv->offer_description));
|
||||
|
||||
if (!wallet_invoice_create(cmd->ld->wallet,
|
||||
&invoice,
|
||||
&msat,
|
||||
label,
|
||||
expiry,
|
||||
b12enc,
|
||||
desc,
|
||||
inv->invoice_features,
|
||||
preimage,
|
||||
&payment_hash,
|
||||
local_offer_id))
|
||||
if (!invoices_create(cmd->ld->wallet->invoices,
|
||||
&inv_dbid,
|
||||
&msat,
|
||||
label,
|
||||
expiry,
|
||||
b12enc,
|
||||
desc,
|
||||
inv->invoice_features,
|
||||
preimage,
|
||||
&payment_hash,
|
||||
local_offer_id))
|
||||
return fail_exists(cmd, label);
|
||||
|
||||
notify_invoice_creation(cmd->ld, &msat, *preimage, label);
|
||||
@@ -1793,8 +1793,8 @@ static struct command_result *json_createinvoice(struct command *cmd,
|
||||
|
||||
response = json_stream_success(cmd);
|
||||
json_add_invoice_fields(response,
|
||||
wallet_invoice_details(cmd, cmd->ld->wallet,
|
||||
invoice));
|
||||
invoices_get_details(cmd, cmd->ld->wallet->invoices,
|
||||
inv_dbid));
|
||||
return command_success(cmd, response);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,36 @@ struct htlc_set;
|
||||
struct lightningd;
|
||||
struct sha256;
|
||||
|
||||
/* The information about an invoice */
|
||||
struct invoice_details {
|
||||
/* Current invoice state */
|
||||
enum invoice_status state;
|
||||
/* Preimage for this invoice */
|
||||
struct preimage r;
|
||||
/* Hash of preimage r */
|
||||
struct sha256 rhash;
|
||||
/* Label assigned by user */
|
||||
const struct json_escape *label;
|
||||
/* NULL if they specified "any" */
|
||||
struct amount_msat *msat;
|
||||
/* Absolute UNIX epoch time this will expire */
|
||||
u64 expiry_time;
|
||||
/* Set if state == PAID; order to be returned by waitanyinvoice */
|
||||
u64 pay_index;
|
||||
/* Set if state == PAID; amount received */
|
||||
struct amount_msat received;
|
||||
/* Set if state == PAID; time paid */
|
||||
u64 paid_timestamp;
|
||||
/* BOLT11 or BOLT12 encoding for this invoice */
|
||||
const char *invstring;
|
||||
|
||||
/* The description of the payment. */
|
||||
char *description;
|
||||
/* The features, if any (tal_arr) */
|
||||
u8 *features;
|
||||
/* The offer this refers to, if any. */
|
||||
struct sha256 *local_offer_id;
|
||||
};
|
||||
|
||||
/**
|
||||
* invoice_check_payment - check if this payment would be valid
|
||||
|
||||
@@ -354,6 +354,78 @@ u8 *invoice_path_id(const tal_t *ctx UNNEEDED,
|
||||
const struct secret *base_secret UNNEEDED,
|
||||
const struct sha256 *payment_hash UNNEEDED)
|
||||
{ fprintf(stderr, "invoice_path_id called!\n"); abort(); }
|
||||
/* Generated stub for invoices_create */
|
||||
bool invoices_create(struct invoices *invoices UNNEEDED,
|
||||
u64 *inv_dbid UNNEEDED,
|
||||
const struct amount_msat *msat TAKES UNNEEDED,
|
||||
const struct json_escape *label TAKES UNNEEDED,
|
||||
u64 expiry UNNEEDED,
|
||||
const char *b11enc UNNEEDED,
|
||||
const char *description UNNEEDED,
|
||||
const u8 *features UNNEEDED,
|
||||
const struct preimage *r UNNEEDED,
|
||||
const struct sha256 *rhash UNNEEDED,
|
||||
const struct sha256 *local_offer_id UNNEEDED)
|
||||
{ fprintf(stderr, "invoices_create called!\n"); abort(); }
|
||||
/* Generated stub for invoices_delete */
|
||||
bool invoices_delete(struct invoices *invoices UNNEEDED, u64 inv_dbid UNNEEDED)
|
||||
{ fprintf(stderr, "invoices_delete called!\n"); abort(); }
|
||||
/* Generated stub for invoices_delete_description */
|
||||
bool invoices_delete_description(struct invoices *invoices UNNEEDED,
|
||||
u64 inv_dbid UNNEEDED)
|
||||
{ fprintf(stderr, "invoices_delete_description called!\n"); abort(); }
|
||||
/* Generated stub for invoices_delete_expired */
|
||||
void invoices_delete_expired(struct invoices *invoices UNNEEDED,
|
||||
u64 max_expiry_time UNNEEDED)
|
||||
{ fprintf(stderr, "invoices_delete_expired called!\n"); abort(); }
|
||||
/* Generated stub for invoices_find_by_label */
|
||||
bool invoices_find_by_label(struct invoices *invoices UNNEEDED,
|
||||
u64 *inv_dbid UNNEEDED,
|
||||
const struct json_escape *label UNNEEDED)
|
||||
{ fprintf(stderr, "invoices_find_by_label called!\n"); abort(); }
|
||||
/* Generated stub for invoices_find_by_rhash */
|
||||
bool invoices_find_by_rhash(struct invoices *invoices UNNEEDED,
|
||||
u64 *inv_dbid UNNEEDED,
|
||||
const struct sha256 *rhash UNNEEDED)
|
||||
{ fprintf(stderr, "invoices_find_by_rhash called!\n"); abort(); }
|
||||
/* Generated stub for invoices_find_unpaid */
|
||||
bool invoices_find_unpaid(struct invoices *invoices UNNEEDED,
|
||||
u64 *inv_dbid UNNEEDED,
|
||||
const struct sha256 *rhash UNNEEDED)
|
||||
{ fprintf(stderr, "invoices_find_unpaid called!\n"); abort(); }
|
||||
/* Generated stub for invoices_get_details */
|
||||
struct invoice_details *invoices_get_details(const tal_t *ctx UNNEEDED,
|
||||
struct invoices *invoices UNNEEDED,
|
||||
u64 inv_dbid UNNEEDED)
|
||||
{ fprintf(stderr, "invoices_get_details called!\n"); abort(); }
|
||||
/* Generated stub for invoices_iterate */
|
||||
bool invoices_iterate(struct invoices *invoices UNNEEDED,
|
||||
struct invoice_iterator *it UNNEEDED)
|
||||
{ fprintf(stderr, "invoices_iterate called!\n"); abort(); }
|
||||
/* Generated stub for invoices_iterator_deref */
|
||||
const struct invoice_details *invoices_iterator_deref(
|
||||
const tal_t *ctx UNNEEDED, struct invoices *invoices UNNEEDED,
|
||||
const struct invoice_iterator *it UNNEEDED)
|
||||
{ fprintf(stderr, "invoices_iterator_deref called!\n"); abort(); }
|
||||
/* Generated stub for invoices_resolve */
|
||||
bool invoices_resolve(struct invoices *invoices UNNEEDED,
|
||||
u64 inv_dbid UNNEEDED,
|
||||
struct amount_msat received UNNEEDED)
|
||||
{ fprintf(stderr, "invoices_resolve called!\n"); abort(); }
|
||||
/* Generated stub for invoices_waitany */
|
||||
void invoices_waitany(const tal_t *ctx UNNEEDED,
|
||||
struct invoices *invoices UNNEEDED,
|
||||
u64 lastpay_index UNNEEDED,
|
||||
void (*cb)(const u64 * UNNEEDED, void*) UNNEEDED,
|
||||
void *cbarg UNNEEDED)
|
||||
{ fprintf(stderr, "invoices_waitany called!\n"); abort(); }
|
||||
/* Generated stub for invoices_waitone */
|
||||
void invoices_waitone(const tal_t *ctx UNNEEDED,
|
||||
struct invoices *invoices UNNEEDED,
|
||||
u64 inv_dbid UNNEEDED,
|
||||
void (*cb)(const u64 * UNNEEDED, void*) UNNEEDED,
|
||||
void *cbarg UNNEEDED)
|
||||
{ fprintf(stderr, "invoices_waitone called!\n"); abort(); }
|
||||
/* Generated stub for json_add_address */
|
||||
void json_add_address(struct json_stream *response UNNEEDED, const char *fieldname UNNEEDED,
|
||||
const struct wireaddr *addr UNNEEDED)
|
||||
@@ -864,79 +936,6 @@ bool wallet_htlcs_load_out_for_channel(struct wallet *wallet UNNEEDED,
|
||||
/* Generated stub for wallet_init_channels */
|
||||
bool wallet_init_channels(struct wallet *w UNNEEDED)
|
||||
{ fprintf(stderr, "wallet_init_channels called!\n"); abort(); }
|
||||
/* Generated stub for wallet_invoice_create */
|
||||
bool wallet_invoice_create(struct wallet *wallet UNNEEDED,
|
||||
struct invoice *pinvoice UNNEEDED,
|
||||
const struct amount_msat *msat TAKES UNNEEDED,
|
||||
const struct json_escape *label TAKES UNNEEDED,
|
||||
u64 expiry UNNEEDED,
|
||||
const char *b11enc UNNEEDED,
|
||||
const char *description UNNEEDED,
|
||||
const u8 *features UNNEEDED,
|
||||
const struct preimage *r UNNEEDED,
|
||||
const struct sha256 *rhash UNNEEDED,
|
||||
const struct sha256 *local_offer_id UNNEEDED)
|
||||
{ fprintf(stderr, "wallet_invoice_create called!\n"); abort(); }
|
||||
/* Generated stub for wallet_invoice_delete */
|
||||
bool wallet_invoice_delete(struct wallet *wallet UNNEEDED,
|
||||
struct invoice invoice UNNEEDED)
|
||||
{ fprintf(stderr, "wallet_invoice_delete called!\n"); abort(); }
|
||||
/* Generated stub for wallet_invoice_delete_description */
|
||||
bool wallet_invoice_delete_description(struct wallet *wallet UNNEEDED,
|
||||
struct invoice invoice UNNEEDED)
|
||||
{ fprintf(stderr, "wallet_invoice_delete_description called!\n"); abort(); }
|
||||
/* Generated stub for wallet_invoice_delete_expired */
|
||||
void wallet_invoice_delete_expired(struct wallet *wallet UNNEEDED,
|
||||
u64 max_expiry_time UNNEEDED)
|
||||
{ fprintf(stderr, "wallet_invoice_delete_expired called!\n"); abort(); }
|
||||
/* Generated stub for wallet_invoice_details */
|
||||
struct invoice_details *wallet_invoice_details(const tal_t *ctx UNNEEDED,
|
||||
struct wallet *wallet UNNEEDED,
|
||||
struct invoice invoice UNNEEDED)
|
||||
{ fprintf(stderr, "wallet_invoice_details called!\n"); abort(); }
|
||||
/* Generated stub for wallet_invoice_find_by_label */
|
||||
bool wallet_invoice_find_by_label(struct wallet *wallet UNNEEDED,
|
||||
struct invoice *pinvoice UNNEEDED,
|
||||
const struct json_escape *label UNNEEDED)
|
||||
{ fprintf(stderr, "wallet_invoice_find_by_label called!\n"); abort(); }
|
||||
/* Generated stub for wallet_invoice_find_by_rhash */
|
||||
bool wallet_invoice_find_by_rhash(struct wallet *wallet UNNEEDED,
|
||||
struct invoice *pinvoice UNNEEDED,
|
||||
const struct sha256 *rhash UNNEEDED)
|
||||
{ fprintf(stderr, "wallet_invoice_find_by_rhash called!\n"); abort(); }
|
||||
/* Generated stub for wallet_invoice_find_unpaid */
|
||||
bool wallet_invoice_find_unpaid(struct wallet *wallet UNNEEDED,
|
||||
struct invoice *pinvoice UNNEEDED,
|
||||
const struct sha256 *rhash UNNEEDED)
|
||||
{ fprintf(stderr, "wallet_invoice_find_unpaid called!\n"); abort(); }
|
||||
/* Generated stub for wallet_invoice_iterate */
|
||||
bool wallet_invoice_iterate(struct wallet *wallet UNNEEDED,
|
||||
struct invoice_iterator *it UNNEEDED)
|
||||
{ fprintf(stderr, "wallet_invoice_iterate called!\n"); abort(); }
|
||||
/* Generated stub for wallet_invoice_iterator_deref */
|
||||
const struct invoice_details *wallet_invoice_iterator_deref(const tal_t *ctx UNNEEDED,
|
||||
struct wallet *wallet UNNEEDED,
|
||||
const struct invoice_iterator *it UNNEEDED)
|
||||
{ fprintf(stderr, "wallet_invoice_iterator_deref called!\n"); abort(); }
|
||||
/* Generated stub for wallet_invoice_resolve */
|
||||
bool wallet_invoice_resolve(struct wallet *wallet UNNEEDED,
|
||||
struct invoice invoice UNNEEDED,
|
||||
struct amount_msat received UNNEEDED)
|
||||
{ fprintf(stderr, "wallet_invoice_resolve called!\n"); abort(); }
|
||||
/* Generated stub for wallet_invoice_waitany */
|
||||
void wallet_invoice_waitany(const tal_t *ctx UNNEEDED,
|
||||
struct wallet *wallet UNNEEDED,
|
||||
u64 lastpay_index UNNEEDED,
|
||||
void (*cb)(const struct invoice * UNNEEDED, void*) UNNEEDED,
|
||||
void *cbarg UNNEEDED)
|
||||
{ fprintf(stderr, "wallet_invoice_waitany called!\n"); abort(); }
|
||||
/* Generated stub for wallet_invoice_waitone */
|
||||
void wallet_invoice_waitone(const tal_t *ctx UNNEEDED,
|
||||
struct wallet *wallet UNNEEDED,
|
||||
struct invoice invoice UNNEEDED,
|
||||
void (*cb)(const struct invoice * UNNEEDED, void*) UNNEEDED,
|
||||
void *cbarg UNNEEDED)
|
||||
{ fprintf(stderr, "wallet_invoice_waitone called!\n"); abort(); }
|
||||
/* Generated stub for wallet_offer_find */
|
||||
char *wallet_offer_find(const tal_t *ctx UNNEEDED,
|
||||
struct wallet *w UNNEEDED,
|
||||
|
||||
Reference in New Issue
Block a user