json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
#include "../channel.c"
|
|
|
|
#include "../invoice.c"
|
|
|
|
#include "../peer_control.c"
|
|
|
|
#include <ccan/alignof/alignof.h>
|
2020-01-26 13:52:29 +01:00
|
|
|
#include <common/errcode.h>
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
|
|
|
|
bool deprecated_apis = false;
|
|
|
|
|
|
|
|
/* AUTOGENERATED MOCKS START */
|
2019-07-30 07:25:12 +02:00
|
|
|
/* Generated stub for bigsize_get */
|
|
|
|
size_t bigsize_get(const u8 *p UNNEEDED, size_t max UNNEEDED, bigsize_t *val UNNEEDED)
|
|
|
|
{ fprintf(stderr, "bigsize_get called!\n"); abort(); }
|
|
|
|
/* Generated stub for bigsize_put */
|
|
|
|
size_t bigsize_put(u8 buf[BIGSIZE_MAX_LEN] UNNEEDED, bigsize_t v UNNEEDED)
|
|
|
|
{ fprintf(stderr, "bigsize_put called!\n"); abort(); }
|
2020-01-09 16:38:12 +01:00
|
|
|
/* Generated stub for bitcoind_getutxout_ */
|
|
|
|
void bitcoind_getutxout_(struct bitcoind *bitcoind UNNEEDED,
|
|
|
|
const struct bitcoin_txid *txid UNNEEDED, const u32 outnum UNNEEDED,
|
|
|
|
void (*cb)(struct bitcoind *bitcoind UNNEEDED,
|
|
|
|
const struct bitcoin_tx_output *txout UNNEEDED,
|
|
|
|
void *arg) UNNEEDED,
|
|
|
|
void *arg UNNEEDED)
|
|
|
|
{ fprintf(stderr, "bitcoind_getutxout_ called!\n"); abort(); }
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
/* Generated stub for bolt11_decode */
|
|
|
|
struct bolt11 *bolt11_decode(const tal_t *ctx UNNEEDED, const char *str UNNEEDED,
|
2020-04-11 05:22:40 +02:00
|
|
|
const struct feature_set *our_features UNNEEDED,
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
const char *description UNNEEDED, char **fail UNNEEDED)
|
|
|
|
{ fprintf(stderr, "bolt11_decode called!\n"); abort(); }
|
|
|
|
/* Generated stub for bolt11_encode_ */
|
|
|
|
char *bolt11_encode_(const tal_t *ctx UNNEEDED,
|
|
|
|
const struct bolt11 *b11 UNNEEDED, bool n_field UNNEEDED,
|
|
|
|
bool (*sign)(const u5 *u5bytes UNNEEDED,
|
|
|
|
const u8 *hrpu8 UNNEEDED,
|
|
|
|
secp256k1_ecdsa_recoverable_signature *rsig UNNEEDED,
|
|
|
|
void *arg) UNNEEDED,
|
|
|
|
void *arg UNNEEDED)
|
|
|
|
{ fprintf(stderr, "bolt11_encode_ called!\n"); abort(); }
|
|
|
|
/* Generated stub for broadcast_tx */
|
|
|
|
void broadcast_tx(struct chain_topology *topo UNNEEDED,
|
|
|
|
struct channel *channel UNNEEDED, const struct bitcoin_tx *tx UNNEEDED,
|
|
|
|
void (*failed)(struct channel *channel UNNEEDED,
|
2020-01-09 12:25:45 +01:00
|
|
|
bool success UNNEEDED,
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
const char *err))
|
|
|
|
{ fprintf(stderr, "broadcast_tx called!\n"); abort(); }
|
2019-02-26 17:57:19 +01:00
|
|
|
/* Generated stub for channel_tell_depth */
|
|
|
|
bool channel_tell_depth(struct lightningd *ld UNNEEDED,
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
struct channel *channel UNNEEDED,
|
|
|
|
const struct bitcoin_txid *txid UNNEEDED,
|
|
|
|
u32 depth UNNEEDED)
|
2019-02-26 17:57:19 +01:00
|
|
|
{ fprintf(stderr, "channel_tell_depth called!\n"); abort(); }
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
/* Generated stub for command_fail */
|
2020-01-26 13:52:29 +01:00
|
|
|
struct command_result *command_fail(struct command *cmd UNNEEDED, errcode_t code UNNEEDED,
|
2018-12-16 05:49:06 +01:00
|
|
|
const char *fmt UNNEEDED, ...)
|
|
|
|
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
{ fprintf(stderr, "command_fail called!\n"); abort(); }
|
2018-10-19 03:17:48 +02:00
|
|
|
/* Generated stub for command_failed */
|
2018-12-16 05:49:06 +01:00
|
|
|
struct command_result *command_failed(struct command *cmd UNNEEDED,
|
2018-12-17 04:52:08 +01:00
|
|
|
struct json_stream *result)
|
|
|
|
|
2018-10-19 03:17:48 +02:00
|
|
|
{ fprintf(stderr, "command_failed called!\n"); abort(); }
|
2018-12-16 05:52:06 +01:00
|
|
|
/* Generated stub for command_its_complicated */
|
2018-12-17 04:52:08 +01:00
|
|
|
struct command_result *command_its_complicated(const char *why UNNEEDED)
|
2018-12-16 05:52:06 +01:00
|
|
|
{ fprintf(stderr, "command_its_complicated called!\n"); abort(); }
|
|
|
|
/* Generated stub for command_param_failed */
|
|
|
|
struct command_result *command_param_failed(void)
|
2018-12-17 04:52:08 +01:00
|
|
|
|
2018-12-16 05:52:06 +01:00
|
|
|
{ fprintf(stderr, "command_param_failed called!\n"); abort(); }
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
/* Generated stub for command_still_pending */
|
2018-12-17 04:52:08 +01:00
|
|
|
struct command_result *command_still_pending(struct command *cmd)
|
|
|
|
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
{ fprintf(stderr, "command_still_pending called!\n"); abort(); }
|
|
|
|
/* Generated stub for command_success */
|
2018-12-16 05:49:06 +01:00
|
|
|
struct command_result *command_success(struct command *cmd UNNEEDED,
|
2018-12-17 04:52:08 +01:00
|
|
|
struct json_stream *response)
|
|
|
|
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
{ fprintf(stderr, "command_success called!\n"); abort(); }
|
|
|
|
/* Generated stub for connect_succeeded */
|
2020-04-02 06:07:47 +02:00
|
|
|
void connect_succeeded(struct lightningd *ld UNNEEDED, const struct peer *peer UNNEEDED)
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
{ fprintf(stderr, "connect_succeeded called!\n"); abort(); }
|
|
|
|
/* Generated stub for delay_then_reconnect */
|
|
|
|
void delay_then_reconnect(struct channel *channel UNNEEDED, u32 seconds_delay UNNEEDED,
|
|
|
|
const struct wireaddr_internal *addrhint TAKES UNNEEDED)
|
|
|
|
{ fprintf(stderr, "delay_then_reconnect called!\n"); abort(); }
|
2019-12-12 18:18:25 +01:00
|
|
|
/* Generated stub for dup_fee_states */
|
|
|
|
struct fee_states *dup_fee_states(const tal_t *ctx UNNEEDED,
|
|
|
|
const struct fee_states *fee_states TAKES UNNEEDED)
|
|
|
|
{ fprintf(stderr, "dup_fee_states called!\n"); abort(); }
|
2019-10-29 18:00:18 +01:00
|
|
|
/* Generated stub for encode_scriptpubkey_to_addr */
|
|
|
|
char *encode_scriptpubkey_to_addr(const tal_t *ctx UNNEEDED,
|
|
|
|
const struct chainparams *chainparams UNNEEDED,
|
2020-01-09 16:38:12 +01:00
|
|
|
const u8 *scriptPubkey UNNEEDED)
|
2019-10-29 18:00:18 +01:00
|
|
|
{ fprintf(stderr, "encode_scriptpubkey_to_addr called!\n"); abort(); }
|
2020-02-21 06:08:39 +01:00
|
|
|
/* Generated stub for failmsg_incorrect_or_unknown */
|
|
|
|
const u8 *failmsg_incorrect_or_unknown(const tal_t *ctx UNNEEDED,
|
2020-04-15 12:19:46 +02:00
|
|
|
struct lightningd *ld UNNEEDED,
|
2020-02-21 06:08:39 +01:00
|
|
|
const struct htlc_in *hin UNNEEDED)
|
|
|
|
{ fprintf(stderr, "failmsg_incorrect_or_unknown called!\n"); abort(); }
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
/* Generated stub for fatal */
|
|
|
|
void fatal(const char *fmt UNNEEDED, ...)
|
|
|
|
{ fprintf(stderr, "fatal called!\n"); abort(); }
|
2019-11-23 01:19:23 +01:00
|
|
|
/* Generated stub for feature_is_set */
|
|
|
|
bool feature_is_set(const u8 *features UNNEEDED, size_t bit UNNEEDED)
|
|
|
|
{ fprintf(stderr, "feature_is_set called!\n"); abort(); }
|
2019-12-12 00:39:10 +01:00
|
|
|
/* Generated stub for fixup_htlcs_out */
|
|
|
|
void fixup_htlcs_out(struct lightningd *ld UNNEEDED)
|
|
|
|
{ fprintf(stderr, "fixup_htlcs_out called!\n"); abort(); }
|
2020-01-26 13:07:50 +01:00
|
|
|
/* Generated stub for fmt_wireaddr_without_port */
|
|
|
|
char *fmt_wireaddr_without_port(const tal_t *ctx UNNEEDED, const struct wireaddr *a UNNEEDED)
|
|
|
|
{ fprintf(stderr, "fmt_wireaddr_without_port called!\n"); abort(); }
|
2018-11-22 03:17:29 +01:00
|
|
|
/* Generated stub for fromwire_channel_dev_memleak_reply */
|
|
|
|
bool fromwire_channel_dev_memleak_reply(const void *p UNNEEDED, bool *leak UNNEEDED)
|
|
|
|
{ fprintf(stderr, "fromwire_channel_dev_memleak_reply called!\n"); abort(); }
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
/* Generated stub for fromwire_connect_peer_connected */
|
2019-10-11 04:52:04 +02:00
|
|
|
bool fromwire_connect_peer_connected(const tal_t *ctx UNNEEDED, const void *p UNNEEDED, struct node_id *id UNNEEDED, struct wireaddr_internal *addr UNNEEDED, struct per_peer_state **pps UNNEEDED, u8 **features UNNEEDED)
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
{ fprintf(stderr, "fromwire_connect_peer_connected called!\n"); abort(); }
|
|
|
|
/* Generated stub for fromwire_gossip_get_incoming_channels_reply */
|
2019-12-17 07:11:08 +01:00
|
|
|
bool fromwire_gossip_get_incoming_channels_reply(const tal_t *ctx UNNEEDED, const void *p UNNEEDED, struct route_info **public_route_info UNNEEDED, bool **public_deadends UNNEEDED, struct route_info **private_route_info UNNEEDED, bool **private_deadends UNNEEDED)
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
{ fprintf(stderr, "fromwire_gossip_get_incoming_channels_reply called!\n"); abort(); }
|
|
|
|
/* Generated stub for fromwire_hsm_get_channel_basepoints_reply */
|
|
|
|
bool fromwire_hsm_get_channel_basepoints_reply(const void *p UNNEEDED, struct basepoints *basepoints UNNEEDED, struct pubkey *funding_pubkey UNNEEDED)
|
|
|
|
{ fprintf(stderr, "fromwire_hsm_get_channel_basepoints_reply called!\n"); abort(); }
|
|
|
|
/* Generated stub for fromwire_hsm_sign_commitment_tx_reply */
|
2018-12-03 00:15:06 +01:00
|
|
|
bool fromwire_hsm_sign_commitment_tx_reply(const void *p UNNEEDED, struct bitcoin_signature *sig UNNEEDED)
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
{ fprintf(stderr, "fromwire_hsm_sign_commitment_tx_reply called!\n"); abort(); }
|
|
|
|
/* Generated stub for fromwire_hsm_sign_invoice_reply */
|
|
|
|
bool fromwire_hsm_sign_invoice_reply(const void *p UNNEEDED, secp256k1_ecdsa_recoverable_signature *sig UNNEEDED)
|
|
|
|
{ fprintf(stderr, "fromwire_hsm_sign_invoice_reply called!\n"); abort(); }
|
2018-11-22 03:17:29 +01:00
|
|
|
/* Generated stub for fromwire_onchain_dev_memleak_reply */
|
|
|
|
bool fromwire_onchain_dev_memleak_reply(const void *p UNNEEDED, bool *leak UNNEEDED)
|
|
|
|
{ fprintf(stderr, "fromwire_onchain_dev_memleak_reply called!\n"); abort(); }
|
2018-11-15 14:08:10 +01:00
|
|
|
/* Generated stub for get_block_height */
|
|
|
|
u32 get_block_height(const struct chain_topology *topo UNNEEDED)
|
|
|
|
{ fprintf(stderr, "get_block_height called!\n"); abort(); }
|
2019-12-12 18:18:25 +01:00
|
|
|
/* Generated stub for get_feerate */
|
|
|
|
u32 get_feerate(const struct fee_states *fee_states UNNEEDED,
|
2019-09-09 18:11:24 +02:00
|
|
|
enum side opener UNNEEDED,
|
2019-12-12 18:18:25 +01:00
|
|
|
enum side side UNNEEDED)
|
|
|
|
{ fprintf(stderr, "get_feerate called!\n"); abort(); }
|
2019-05-31 09:30:32 +02:00
|
|
|
/* Generated stub for htlc_is_trimmed */
|
|
|
|
bool htlc_is_trimmed(enum side htlc_owner UNNEEDED,
|
|
|
|
struct amount_msat htlc_amount UNNEEDED,
|
|
|
|
u32 feerate_per_kw UNNEEDED,
|
|
|
|
struct amount_sat dust_limit UNNEEDED,
|
|
|
|
enum side side UNNEEDED)
|
|
|
|
{ fprintf(stderr, "htlc_is_trimmed called!\n"); abort(); }
|
2019-12-12 00:55:45 +01:00
|
|
|
/* Generated stub for htlc_set_fail */
|
2020-02-21 06:08:39 +01:00
|
|
|
void htlc_set_fail(struct htlc_set *set UNNEEDED, const u8 *failmsg TAKES UNNEEDED)
|
2019-12-12 00:55:45 +01:00
|
|
|
{ fprintf(stderr, "htlc_set_fail called!\n"); abort(); }
|
|
|
|
/* Generated stub for htlc_set_fulfill */
|
|
|
|
void htlc_set_fulfill(struct htlc_set *set UNNEEDED, const struct preimage *preimage UNNEEDED)
|
|
|
|
{ fprintf(stderr, "htlc_set_fulfill called!\n"); abort(); }
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
/* Generated stub for json_add_log */
|
2018-10-19 03:17:49 +02:00
|
|
|
void json_add_log(struct json_stream *result UNNEEDED,
|
2019-11-18 01:27:15 +01:00
|
|
|
const struct log_book *lr UNNEEDED,
|
|
|
|
const struct node_id *node_id UNNEEDED,
|
|
|
|
enum log_level minlevel UNNEEDED)
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
{ fprintf(stderr, "json_add_log called!\n"); abort(); }
|
2020-01-26 13:07:50 +01:00
|
|
|
/* Generated stub for json_add_member */
|
|
|
|
void json_add_member(struct json_stream *js UNNEEDED,
|
2019-11-23 01:19:23 +01:00
|
|
|
const char *fieldname UNNEEDED,
|
2020-01-26 13:07:50 +01:00
|
|
|
bool quote UNNEEDED,
|
|
|
|
const char *fmt UNNEEDED, ...)
|
|
|
|
{ fprintf(stderr, "json_add_member called!\n"); abort(); }
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
/* Generated stub for json_add_uncommitted_channel */
|
2018-10-19 03:17:49 +02:00
|
|
|
void json_add_uncommitted_channel(struct json_stream *response UNNEEDED,
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
const struct uncommitted_channel *uc UNNEEDED)
|
|
|
|
{ fprintf(stderr, "json_add_uncommitted_channel called!\n"); abort(); }
|
|
|
|
/* Generated stub for json_array_end */
|
2018-11-20 02:46:32 +01:00
|
|
|
void json_array_end(struct json_stream *js UNNEEDED)
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
{ fprintf(stderr, "json_array_end called!\n"); abort(); }
|
|
|
|
/* Generated stub for json_array_start */
|
2018-11-20 02:46:32 +01:00
|
|
|
void json_array_start(struct json_stream *js UNNEEDED, const char *fieldname UNNEEDED)
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
{ fprintf(stderr, "json_array_start called!\n"); abort(); }
|
2020-01-26 13:07:50 +01:00
|
|
|
/* Generated stub for json_member_direct */
|
|
|
|
char *json_member_direct(struct json_stream *js UNNEEDED,
|
|
|
|
const char *fieldname UNNEEDED, size_t extra UNNEEDED)
|
|
|
|
{ fprintf(stderr, "json_member_direct called!\n"); abort(); }
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
/* Generated stub for json_object_end */
|
2018-11-20 02:46:32 +01:00
|
|
|
void json_object_end(struct json_stream *js UNNEEDED)
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
{ fprintf(stderr, "json_object_end called!\n"); abort(); }
|
|
|
|
/* Generated stub for json_object_start */
|
2018-11-20 02:46:32 +01:00
|
|
|
void json_object_start(struct json_stream *ks UNNEEDED, const char *fieldname UNNEEDED)
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
{ fprintf(stderr, "json_object_start called!\n"); abort(); }
|
2018-10-19 03:17:48 +02:00
|
|
|
/* Generated stub for json_stream_fail */
|
2018-10-19 03:17:49 +02:00
|
|
|
struct json_stream *json_stream_fail(struct command *cmd UNNEEDED,
|
2020-01-31 09:19:32 +01:00
|
|
|
errcode_t code UNNEEDED,
|
2018-10-19 03:17:48 +02:00
|
|
|
const char *errmsg UNNEEDED)
|
|
|
|
{ fprintf(stderr, "json_stream_fail called!\n"); abort(); }
|
|
|
|
/* Generated stub for json_stream_success */
|
2018-10-19 03:17:49 +02:00
|
|
|
struct json_stream *json_stream_success(struct command *cmd UNNEEDED)
|
2018-10-19 03:17:48 +02:00
|
|
|
{ fprintf(stderr, "json_stream_success called!\n"); abort(); }
|
2019-10-06 14:12:41 +02:00
|
|
|
/* Generated stub for json_to_address_scriptpubkey */
|
|
|
|
enum address_parse_result json_to_address_scriptpubkey(const tal_t *ctx UNNEEDED,
|
2018-12-16 05:50:06 +01:00
|
|
|
const struct chainparams *chainparams UNNEEDED,
|
|
|
|
const char *buffer UNNEEDED,
|
|
|
|
const jsmntok_t *tok UNNEEDED, const u8 **scriptpubkey UNNEEDED)
|
2019-10-06 14:12:41 +02:00
|
|
|
{ fprintf(stderr, "json_to_address_scriptpubkey called!\n"); abort(); }
|
2019-04-08 11:58:32 +02:00
|
|
|
/* Generated stub for json_to_node_id */
|
|
|
|
bool json_to_node_id(const char *buffer UNNEEDED, const jsmntok_t *tok UNNEEDED,
|
|
|
|
struct node_id *id UNNEEDED)
|
|
|
|
{ fprintf(stderr, "json_to_node_id called!\n"); abort(); }
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
/* Generated stub for json_to_short_channel_id */
|
|
|
|
bool json_to_short_channel_id(const char *buffer UNNEEDED, const jsmntok_t *tok UNNEEDED,
|
2019-09-06 08:41:41 +02:00
|
|
|
struct short_channel_id *scid UNNEEDED)
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
{ fprintf(stderr, "json_to_short_channel_id called!\n"); abort(); }
|
2020-03-10 17:54:09 +01:00
|
|
|
/* Generated stub for json_tok_channel_id */
|
|
|
|
bool json_tok_channel_id(const char *buffer UNNEEDED, const jsmntok_t *tok UNNEEDED,
|
|
|
|
struct channel_id *cid UNNEEDED)
|
|
|
|
{ fprintf(stderr, "json_tok_channel_id called!\n"); abort(); }
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
/* Generated stub for kill_uncommitted_channel */
|
|
|
|
void kill_uncommitted_channel(struct uncommitted_channel *uc UNNEEDED,
|
|
|
|
const char *why UNNEEDED)
|
|
|
|
{ fprintf(stderr, "kill_uncommitted_channel called!\n"); abort(); }
|
|
|
|
/* Generated stub for log_ */
|
2019-11-17 12:41:33 +01:00
|
|
|
void log_(struct log *log UNNEEDED, enum log_level level UNNEEDED,
|
|
|
|
const struct node_id *node_id UNNEEDED,
|
|
|
|
bool call_notifier UNNEEDED,
|
|
|
|
const char *fmt UNNEEDED, ...)
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
|
|
|
|
{ fprintf(stderr, "log_ called!\n"); abort(); }
|
|
|
|
/* Generated stub for new_bolt11 */
|
2019-02-21 03:38:35 +01:00
|
|
|
struct bolt11 *new_bolt11(const tal_t *ctx UNNEEDED,
|
|
|
|
const struct amount_msat *msat TAKES UNNEEDED)
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
{ fprintf(stderr, "new_bolt11 called!\n"); abort(); }
|
|
|
|
/* Generated stub for new_log */
|
2019-11-17 12:41:33 +01:00
|
|
|
struct log *new_log(const tal_t *ctx UNNEEDED, struct log_book *record UNNEEDED,
|
|
|
|
const struct node_id *default_node_id UNNEEDED,
|
|
|
|
const char *fmt UNNEEDED, ...)
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
{ fprintf(stderr, "new_log called!\n"); abort(); }
|
|
|
|
/* Generated stub for new_reltimer_ */
|
|
|
|
struct oneshot *new_reltimer_(struct timers *timers UNNEEDED,
|
|
|
|
const tal_t *ctx UNNEEDED,
|
|
|
|
struct timerel expire UNNEEDED,
|
|
|
|
void (*cb)(void *) UNNEEDED, void *arg UNNEEDED)
|
|
|
|
{ fprintf(stderr, "new_reltimer_ called!\n"); abort(); }
|
2019-04-08 11:58:32 +02:00
|
|
|
/* Generated stub for node_id_cmp */
|
|
|
|
int node_id_cmp(const struct node_id *a UNNEEDED, const struct node_id *b UNNEEDED)
|
|
|
|
{ fprintf(stderr, "node_id_cmp called!\n"); abort(); }
|
|
|
|
/* Generated stub for node_id_to_hexstr */
|
|
|
|
char *node_id_to_hexstr(const tal_t *ctx UNNEEDED, const struct node_id *id UNNEEDED)
|
|
|
|
{ fprintf(stderr, "node_id_to_hexstr called!\n"); abort(); }
|
2018-12-13 13:58:40 +01:00
|
|
|
/* Generated stub for notify_connect */
|
2019-04-08 11:58:32 +02:00
|
|
|
void notify_connect(struct lightningd *ld UNNEEDED, struct node_id *nodeid UNNEEDED,
|
2018-12-13 13:58:40 +01:00
|
|
|
struct wireaddr_internal *addr UNNEEDED)
|
|
|
|
{ fprintf(stderr, "notify_connect called!\n"); abort(); }
|
|
|
|
/* Generated stub for notify_disconnect */
|
2019-04-08 11:58:32 +02:00
|
|
|
void notify_disconnect(struct lightningd *ld UNNEEDED, struct node_id *nodeid UNNEEDED)
|
2018-12-13 13:58:40 +01:00
|
|
|
{ fprintf(stderr, "notify_disconnect called!\n"); abort(); }
|
2020-04-21 03:04:01 +02:00
|
|
|
/* Generated stub for notify_invoice_creation */
|
|
|
|
void notify_invoice_creation(struct lightningd *ld UNNEEDED, struct amount_msat *amount UNNEEDED,
|
|
|
|
struct preimage preimage UNNEEDED, const struct json_escape *label UNNEEDED)
|
|
|
|
{ fprintf(stderr, "notify_invoice_creation called!\n"); abort(); }
|
2019-07-21 13:39:15 +02:00
|
|
|
/* Generated stub for notify_invoice_payment */
|
|
|
|
void notify_invoice_payment(struct lightningd *ld UNNEEDED, struct amount_msat amount UNNEEDED,
|
|
|
|
struct preimage preimage UNNEEDED, const struct json_escape *label UNNEEDED)
|
|
|
|
{ fprintf(stderr, "notify_invoice_payment called!\n"); abort(); }
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
/* Generated stub for onchaind_funding_spent */
|
|
|
|
enum watch_result onchaind_funding_spent(struct channel *channel UNNEEDED,
|
|
|
|
const struct bitcoin_tx *tx UNNEEDED,
|
|
|
|
u32 blockheight UNNEEDED)
|
|
|
|
{ fprintf(stderr, "onchaind_funding_spent called!\n"); abort(); }
|
|
|
|
/* Generated stub for param */
|
|
|
|
bool param(struct command *cmd UNNEEDED, const char *buffer UNNEEDED,
|
|
|
|
const jsmntok_t params[] UNNEEDED, ...)
|
|
|
|
{ fprintf(stderr, "param called!\n"); abort(); }
|
2018-12-16 05:50:06 +01:00
|
|
|
/* Generated stub for param_array */
|
|
|
|
struct command_result *param_array(struct command *cmd UNNEEDED, const char *name UNNEEDED,
|
|
|
|
const char *buffer UNNEEDED, const jsmntok_t *tok UNNEEDED,
|
|
|
|
const jsmntok_t **arr UNNEEDED)
|
|
|
|
{ fprintf(stderr, "param_array called!\n"); abort(); }
|
2019-12-04 16:26:57 +01:00
|
|
|
/* Generated stub for param_bin_from_hex */
|
|
|
|
struct command_result *param_bin_from_hex(struct command *cmd UNNEEDED, const char *name UNNEEDED,
|
|
|
|
const char *buffer UNNEEDED, const jsmntok_t *tok UNNEEDED,
|
|
|
|
u8 **bin UNNEEDED)
|
|
|
|
{ fprintf(stderr, "param_bin_from_hex called!\n"); abort(); }
|
2019-10-11 12:23:12 +02:00
|
|
|
/* Generated stub for param_bitcoin_address */
|
|
|
|
struct command_result *param_bitcoin_address(struct command *cmd UNNEEDED,
|
|
|
|
const char *name UNNEEDED,
|
|
|
|
const char *buffer UNNEEDED,
|
|
|
|
const jsmntok_t *tok UNNEEDED,
|
|
|
|
const u8 **scriptpubkey UNNEEDED)
|
|
|
|
{ fprintf(stderr, "param_bitcoin_address called!\n"); abort(); }
|
2018-12-16 05:50:06 +01:00
|
|
|
/* Generated stub for param_bool */
|
|
|
|
struct command_result *param_bool(struct command *cmd UNNEEDED, const char *name UNNEEDED,
|
|
|
|
const char *buffer UNNEEDED, const jsmntok_t *tok UNNEEDED,
|
|
|
|
bool **b UNNEEDED)
|
|
|
|
{ fprintf(stderr, "param_bool called!\n"); abort(); }
|
2019-09-30 18:31:27 +02:00
|
|
|
/* Generated stub for param_channel_id */
|
|
|
|
struct command_result *param_channel_id(struct command *cmd UNNEEDED,
|
|
|
|
const char *name UNNEEDED,
|
|
|
|
const char *buffer UNNEEDED,
|
|
|
|
const jsmntok_t *tok UNNEEDED,
|
|
|
|
struct channel_id **cid UNNEEDED)
|
|
|
|
{ fprintf(stderr, "param_channel_id called!\n"); abort(); }
|
2018-12-16 05:50:06 +01:00
|
|
|
/* Generated stub for param_escaped_string */
|
|
|
|
struct command_result *param_escaped_string(struct command *cmd UNNEEDED,
|
|
|
|
const char *name UNNEEDED,
|
|
|
|
const char *buffer UNNEEDED,
|
|
|
|
const jsmntok_t *tok UNNEEDED,
|
|
|
|
const char **str UNNEEDED)
|
|
|
|
{ fprintf(stderr, "param_escaped_string called!\n"); abort(); }
|
|
|
|
/* Generated stub for param_label */
|
|
|
|
struct command_result *param_label(struct command *cmd UNNEEDED, const char *name UNNEEDED,
|
|
|
|
const char * buffer UNNEEDED, const jsmntok_t *tok UNNEEDED,
|
2019-06-12 02:38:54 +02:00
|
|
|
struct json_escape **label UNNEEDED)
|
2018-12-16 05:50:06 +01:00
|
|
|
{ fprintf(stderr, "param_label called!\n"); abort(); }
|
|
|
|
/* Generated stub for param_loglevel */
|
|
|
|
struct command_result *param_loglevel(struct command *cmd UNNEEDED,
|
|
|
|
const char *name UNNEEDED,
|
|
|
|
const char *buffer UNNEEDED,
|
|
|
|
const jsmntok_t *tok UNNEEDED,
|
|
|
|
enum log_level **level UNNEEDED)
|
|
|
|
{ fprintf(stderr, "param_loglevel called!\n"); abort(); }
|
2019-03-09 21:29:39 +01:00
|
|
|
/* Generated stub for param_msat */
|
|
|
|
struct command_result *param_msat(struct command *cmd UNNEEDED, const char *name UNNEEDED,
|
|
|
|
const char *buffer UNNEEDED, const jsmntok_t *tok UNNEEDED,
|
|
|
|
struct amount_msat **msat UNNEEDED)
|
|
|
|
{ fprintf(stderr, "param_msat called!\n"); abort(); }
|
2019-04-08 11:58:32 +02:00
|
|
|
/* Generated stub for param_node_id */
|
|
|
|
struct command_result *param_node_id(struct command *cmd UNNEEDED,
|
2019-09-20 08:58:51 +02:00
|
|
|
const char *name UNNEEDED,
|
|
|
|
const char *buffer UNNEEDED,
|
|
|
|
const jsmntok_t *tok UNNEEDED,
|
|
|
|
struct node_id **id UNNEEDED)
|
2019-04-08 11:58:32 +02:00
|
|
|
{ fprintf(stderr, "param_node_id called!\n"); abort(); }
|
2018-12-16 05:50:06 +01:00
|
|
|
/* Generated stub for param_number */
|
|
|
|
struct command_result *param_number(struct command *cmd UNNEEDED, const char *name UNNEEDED,
|
|
|
|
const char *buffer UNNEEDED, const jsmntok_t *tok UNNEEDED,
|
|
|
|
unsigned int **num UNNEEDED)
|
|
|
|
{ fprintf(stderr, "param_number called!\n"); abort(); }
|
|
|
|
/* Generated stub for param_short_channel_id */
|
|
|
|
struct command_result *param_short_channel_id(struct command *cmd UNNEEDED,
|
|
|
|
const char *name UNNEEDED,
|
|
|
|
const char *buffer UNNEEDED,
|
|
|
|
const jsmntok_t *tok UNNEEDED,
|
|
|
|
struct short_channel_id **scid UNNEEDED)
|
|
|
|
{ fprintf(stderr, "param_short_channel_id called!\n"); abort(); }
|
|
|
|
/* Generated stub for param_string */
|
|
|
|
struct command_result *param_string(struct command *cmd UNNEEDED, const char *name UNNEEDED,
|
|
|
|
const char * buffer UNNEEDED, const jsmntok_t *tok UNNEEDED,
|
|
|
|
const char **str UNNEEDED)
|
|
|
|
{ fprintf(stderr, "param_string called!\n"); abort(); }
|
|
|
|
/* Generated stub for param_tok */
|
|
|
|
struct command_result *param_tok(struct command *cmd UNNEEDED, const char *name UNNEEDED,
|
|
|
|
const char *buffer UNNEEDED, const jsmntok_t * tok UNNEEDED,
|
|
|
|
const jsmntok_t **out UNNEEDED)
|
|
|
|
{ fprintf(stderr, "param_tok called!\n"); abort(); }
|
|
|
|
/* Generated stub for param_u64 */
|
|
|
|
struct command_result *param_u64(struct command *cmd UNNEEDED, const char *name UNNEEDED,
|
|
|
|
const char *buffer UNNEEDED, const jsmntok_t *tok UNNEEDED,
|
|
|
|
uint64_t **num UNNEEDED)
|
|
|
|
{ fprintf(stderr, "param_u64 called!\n"); abort(); }
|
2019-12-04 16:26:57 +01:00
|
|
|
/* Generated stub for peer_get_owning_subd */
|
|
|
|
struct subd *peer_get_owning_subd(struct peer *peer UNNEEDED)
|
|
|
|
{ fprintf(stderr, "peer_get_owning_subd called!\n"); abort(); }
|
2018-11-22 03:17:29 +01:00
|
|
|
/* Generated stub for peer_memleak_done */
|
|
|
|
void peer_memleak_done(struct command *cmd UNNEEDED, struct subd *leaker UNNEEDED)
|
|
|
|
{ fprintf(stderr, "peer_memleak_done called!\n"); abort(); }
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
/* Generated stub for peer_start_channeld */
|
|
|
|
void peer_start_channeld(struct channel *channel UNNEEDED,
|
2019-06-03 20:11:25 +02:00
|
|
|
struct per_peer_state *pps UNNEEDED,
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
const u8 *funding_signed UNNEEDED,
|
|
|
|
bool reconnected UNNEEDED)
|
|
|
|
{ fprintf(stderr, "peer_start_channeld called!\n"); abort(); }
|
|
|
|
/* Generated stub for peer_start_closingd */
|
|
|
|
void peer_start_closingd(struct channel *channel UNNEEDED,
|
2019-06-03 20:11:25 +02:00
|
|
|
struct per_peer_state *pps UNNEEDED,
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
bool reconnected UNNEEDED,
|
|
|
|
const u8 *channel_reestablish UNNEEDED)
|
|
|
|
{ fprintf(stderr, "peer_start_closingd called!\n"); abort(); }
|
|
|
|
/* Generated stub for peer_start_openingd */
|
|
|
|
void peer_start_openingd(struct peer *peer UNNEEDED,
|
2019-06-03 20:11:25 +02:00
|
|
|
struct per_peer_state *pps UNNEEDED,
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
const u8 *msg UNNEEDED)
|
|
|
|
{ fprintf(stderr, "peer_start_openingd called!\n"); abort(); }
|
2019-06-03 20:11:25 +02:00
|
|
|
/* Generated stub for per_peer_state_set_fds */
|
|
|
|
void per_peer_state_set_fds(struct per_peer_state *pps UNNEEDED,
|
|
|
|
int peer_fd UNNEEDED, int gossip_fd UNNEEDED, int gossip_store_fd UNNEEDED)
|
|
|
|
{ fprintf(stderr, "per_peer_state_set_fds called!\n"); abort(); }
|
2019-01-19 15:56:05 +01:00
|
|
|
/* Generated stub for plugin_hook_call_ */
|
|
|
|
void plugin_hook_call_(struct lightningd *ld UNNEEDED, const struct plugin_hook *hook UNNEEDED,
|
2020-05-04 09:19:53 +02:00
|
|
|
tal_t *cb_arg STEALS UNNEEDED)
|
2019-01-19 15:56:05 +01:00
|
|
|
{ fprintf(stderr, "plugin_hook_call_ called!\n"); abort(); }
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
/* Generated stub for subd_release_channel */
|
|
|
|
void subd_release_channel(struct subd *owner UNNEEDED, void *channel UNNEEDED)
|
|
|
|
{ fprintf(stderr, "subd_release_channel called!\n"); abort(); }
|
|
|
|
/* Generated stub for subd_req_ */
|
|
|
|
void subd_req_(const tal_t *ctx UNNEEDED,
|
|
|
|
struct subd *sd UNNEEDED,
|
|
|
|
const u8 *msg_out UNNEEDED,
|
|
|
|
int fd_out UNNEEDED, size_t num_fds_in UNNEEDED,
|
|
|
|
void (*replycb)(struct subd * UNNEEDED, const u8 * UNNEEDED, const int * UNNEEDED, void *) UNNEEDED,
|
|
|
|
void *replycb_data UNNEEDED)
|
|
|
|
{ fprintf(stderr, "subd_req_ called!\n"); abort(); }
|
|
|
|
/* Generated stub for subd_send_msg */
|
|
|
|
void subd_send_msg(struct subd *sd UNNEEDED, const u8 *msg_out UNNEEDED)
|
|
|
|
{ fprintf(stderr, "subd_send_msg called!\n"); abort(); }
|
2018-11-22 03:17:29 +01:00
|
|
|
/* Generated stub for towire_channel_dev_memleak */
|
|
|
|
u8 *towire_channel_dev_memleak(const tal_t *ctx UNNEEDED)
|
|
|
|
{ fprintf(stderr, "towire_channel_dev_memleak called!\n"); abort(); }
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
/* Generated stub for towire_channel_dev_reenable_commit */
|
|
|
|
u8 *towire_channel_dev_reenable_commit(const tal_t *ctx UNNEEDED)
|
|
|
|
{ fprintf(stderr, "towire_channel_dev_reenable_commit called!\n"); abort(); }
|
|
|
|
/* Generated stub for towire_channel_send_shutdown */
|
2019-09-29 10:53:26 +02:00
|
|
|
u8 *towire_channel_send_shutdown(const tal_t *ctx UNNEEDED, const u8 *shutdown_scriptpubkey UNNEEDED)
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
{ fprintf(stderr, "towire_channel_send_shutdown called!\n"); abort(); }
|
2019-03-09 21:29:39 +01:00
|
|
|
/* Generated stub for towire_channel_specific_feerates */
|
|
|
|
u8 *towire_channel_specific_feerates(const tal_t *ctx UNNEEDED, u32 feerate_base UNNEEDED, u32 feerate_ppm UNNEEDED)
|
|
|
|
{ fprintf(stderr, "towire_channel_specific_feerates called!\n"); abort(); }
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
/* Generated stub for towire_connectctl_connect_to_peer */
|
2019-04-08 11:58:32 +02:00
|
|
|
u8 *towire_connectctl_connect_to_peer(const tal_t *ctx UNNEEDED, const struct node_id *id UNNEEDED, u32 seconds_waited UNNEEDED, const struct wireaddr_internal *addrhint UNNEEDED)
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
{ fprintf(stderr, "towire_connectctl_connect_to_peer called!\n"); abort(); }
|
|
|
|
/* Generated stub for towire_connectctl_peer_disconnected */
|
2019-04-08 11:58:32 +02:00
|
|
|
u8 *towire_connectctl_peer_disconnected(const tal_t *ctx UNNEEDED, const struct node_id *id UNNEEDED)
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
{ fprintf(stderr, "towire_connectctl_peer_disconnected called!\n"); abort(); }
|
|
|
|
/* Generated stub for towire_errorfmt */
|
|
|
|
u8 *towire_errorfmt(const tal_t *ctx UNNEEDED,
|
|
|
|
const struct channel_id *channel UNNEEDED,
|
|
|
|
const char *fmt UNNEEDED, ...)
|
|
|
|
{ fprintf(stderr, "towire_errorfmt called!\n"); abort(); }
|
|
|
|
/* Generated stub for towire_gossip_get_incoming_channels */
|
2019-12-17 07:11:08 +01:00
|
|
|
u8 *towire_gossip_get_incoming_channels(const tal_t *ctx UNNEEDED)
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
{ fprintf(stderr, "towire_gossip_get_incoming_channels called!\n"); abort(); }
|
|
|
|
/* Generated stub for towire_hsm_get_channel_basepoints */
|
2019-04-08 11:58:32 +02:00
|
|
|
u8 *towire_hsm_get_channel_basepoints(const tal_t *ctx UNNEEDED, const struct node_id *peerid UNNEEDED, u64 dbid UNNEEDED)
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
{ fprintf(stderr, "towire_hsm_get_channel_basepoints called!\n"); abort(); }
|
|
|
|
/* Generated stub for towire_hsm_sign_commitment_tx */
|
2019-04-08 11:58:32 +02:00
|
|
|
u8 *towire_hsm_sign_commitment_tx(const tal_t *ctx UNNEEDED, const struct node_id *peer_id UNNEEDED, u64 channel_dbid UNNEEDED, const struct bitcoin_tx *tx UNNEEDED, const struct pubkey *remote_funding_key UNNEEDED, struct amount_sat funding_amount UNNEEDED)
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
{ fprintf(stderr, "towire_hsm_sign_commitment_tx called!\n"); abort(); }
|
|
|
|
/* Generated stub for towire_hsm_sign_invoice */
|
|
|
|
u8 *towire_hsm_sign_invoice(const tal_t *ctx UNNEEDED, const u8 *u5bytes UNNEEDED, const u8 *hrp UNNEEDED)
|
|
|
|
{ fprintf(stderr, "towire_hsm_sign_invoice called!\n"); abort(); }
|
2018-11-22 03:17:29 +01:00
|
|
|
/* Generated stub for towire_onchain_dev_memleak */
|
|
|
|
u8 *towire_onchain_dev_memleak(const tal_t *ctx UNNEEDED)
|
|
|
|
{ fprintf(stderr, "towire_onchain_dev_memleak called!\n"); abort(); }
|
2020-02-21 06:08:39 +01:00
|
|
|
/* Generated stub for towire_temporary_node_failure */
|
|
|
|
u8 *towire_temporary_node_failure(const tal_t *ctx UNNEEDED)
|
|
|
|
{ fprintf(stderr, "towire_temporary_node_failure called!\n"); abort(); }
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
/* Generated stub for txfilter_add_scriptpubkey */
|
|
|
|
void txfilter_add_scriptpubkey(struct txfilter *filter UNNEEDED, const u8 *script TAKES UNNEEDED)
|
|
|
|
{ fprintf(stderr, "txfilter_add_scriptpubkey called!\n"); abort(); }
|
2018-11-15 14:08:10 +01:00
|
|
|
/* Generated stub for version */
|
|
|
|
const char *version(void)
|
|
|
|
{ fprintf(stderr, "version called!\n"); abort(); }
|
2019-10-03 19:31:00 +02:00
|
|
|
/* Generated stub for wallet_annotate_txout */
|
|
|
|
void wallet_annotate_txout(struct wallet *w UNNEEDED, const struct bitcoin_txid *txid UNNEEDED,
|
|
|
|
int outnum UNNEEDED, enum wallet_tx_type type UNNEEDED, u64 channel UNNEEDED)
|
|
|
|
{ fprintf(stderr, "wallet_annotate_txout called!\n"); abort(); }
|
2019-06-22 15:08:21 +02:00
|
|
|
/* Generated stub for wallet_channel_close */
|
|
|
|
void wallet_channel_close(struct wallet *w UNNEEDED, u64 wallet_id UNNEEDED)
|
|
|
|
{ fprintf(stderr, "wallet_channel_close called!\n"); abort(); }
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
/* Generated stub for wallet_channel_save */
|
|
|
|
void wallet_channel_save(struct wallet *w UNNEEDED, struct channel *chan UNNEEDED)
|
|
|
|
{ fprintf(stderr, "wallet_channel_save called!\n"); abort(); }
|
|
|
|
/* Generated stub for wallet_channel_stats_load */
|
|
|
|
void wallet_channel_stats_load(struct wallet *w UNNEEDED, u64 cdbid UNNEEDED, struct channel_stats *stats UNNEEDED)
|
|
|
|
{ fprintf(stderr, "wallet_channel_stats_load called!\n"); abort(); }
|
|
|
|
/* Generated stub for wallet_channeltxs_add */
|
|
|
|
void wallet_channeltxs_add(struct wallet *w UNNEEDED, struct channel *chan UNNEEDED,
|
|
|
|
const int type UNNEEDED, const struct bitcoin_txid *txid UNNEEDED,
|
|
|
|
const u32 input_num UNNEEDED, const u32 blockheight UNNEEDED)
|
|
|
|
{ fprintf(stderr, "wallet_channeltxs_add called!\n"); abort(); }
|
2019-12-12 00:39:10 +01:00
|
|
|
/* Generated stub for wallet_htlcs_load_in_for_channel */
|
|
|
|
bool wallet_htlcs_load_in_for_channel(struct wallet *wallet UNNEEDED,
|
|
|
|
struct channel *chan UNNEEDED,
|
|
|
|
struct htlc_in_map *htlcs_in UNNEEDED)
|
|
|
|
{ fprintf(stderr, "wallet_htlcs_load_in_for_channel called!\n"); abort(); }
|
|
|
|
/* Generated stub for wallet_htlcs_load_out_for_channel */
|
|
|
|
bool wallet_htlcs_load_out_for_channel(struct wallet *wallet UNNEEDED,
|
|
|
|
struct channel *chan UNNEEDED,
|
|
|
|
struct htlc_out_map *htlcs_out UNNEEDED,
|
|
|
|
struct htlc_in_map *remaining_htlcs_in UNNEEDED)
|
|
|
|
{ fprintf(stderr, "wallet_htlcs_load_out_for_channel called!\n"); abort(); }
|
2019-08-27 06:20:05 +02:00
|
|
|
/* Generated stub for wallet_init_channels */
|
|
|
|
bool wallet_init_channels(struct wallet *w UNNEEDED)
|
|
|
|
{ fprintf(stderr, "wallet_init_channels called!\n"); abort(); }
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
/* Generated stub for wallet_invoice_create */
|
|
|
|
bool wallet_invoice_create(struct wallet *wallet UNNEEDED,
|
|
|
|
struct invoice *pinvoice UNNEEDED,
|
2019-02-21 03:38:35 +01:00
|
|
|
const struct amount_msat *msat TAKES UNNEEDED,
|
2019-06-12 02:38:54 +02:00
|
|
|
const struct json_escape *label TAKES UNNEEDED,
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
u64 expiry UNNEEDED,
|
|
|
|
const char *b11enc UNNEEDED,
|
|
|
|
const char *description UNNEEDED,
|
2019-11-23 01:19:23 +01:00
|
|
|
const u8 *features UNNEEDED,
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
const struct preimage *r UNNEEDED,
|
|
|
|
const struct sha256 *rhash 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_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 */
|
|
|
|
const 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,
|
2019-06-12 02:38:54 +02:00
|
|
|
const struct json_escape *label UNNEEDED)
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
{ 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(); }
|
2019-04-11 02:08:55 +02:00
|
|
|
/* 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(); }
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
/* 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(); }
|
2019-04-11 02:08:55 +02:00
|
|
|
/* Generated stub for wallet_invoice_resolve */
|
|
|
|
void wallet_invoice_resolve(struct wallet *wallet UNNEEDED,
|
|
|
|
struct invoice invoice UNNEEDED,
|
|
|
|
struct amount_msat received UNNEEDED)
|
|
|
|
{ fprintf(stderr, "wallet_invoice_resolve called!\n"); abort(); }
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
/* 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_peer_delete */
|
|
|
|
void wallet_peer_delete(struct wallet *w UNNEEDED, u64 peer_dbid UNNEEDED)
|
|
|
|
{ fprintf(stderr, "wallet_peer_delete called!\n"); abort(); }
|
2018-11-15 14:08:10 +01:00
|
|
|
/* Generated stub for wallet_total_forward_fees */
|
2019-02-21 04:45:55 +01:00
|
|
|
struct amount_msat wallet_total_forward_fees(struct wallet *w UNNEEDED)
|
2018-11-15 14:08:10 +01:00
|
|
|
{ fprintf(stderr, "wallet_total_forward_fees called!\n"); abort(); }
|
2019-05-24 12:27:40 +02:00
|
|
|
/* Generated stub for wallet_transaction_add */
|
|
|
|
void wallet_transaction_add(struct wallet *w UNNEEDED, const struct bitcoin_tx *tx UNNEEDED,
|
|
|
|
const u32 blockheight UNNEEDED, const u32 txindex UNNEEDED)
|
|
|
|
{ fprintf(stderr, "wallet_transaction_add called!\n"); abort(); }
|
2019-05-23 23:19:49 +02:00
|
|
|
/* Generated stub for wallet_transaction_annotate */
|
|
|
|
void wallet_transaction_annotate(struct wallet *w UNNEEDED,
|
2019-06-07 11:38:20 +02:00
|
|
|
const struct bitcoin_txid *txid UNNEEDED,
|
|
|
|
enum wallet_tx_type type UNNEEDED, u64 channel_id UNNEEDED)
|
2019-05-23 23:19:49 +02:00
|
|
|
{ fprintf(stderr, "wallet_transaction_annotate called!\n"); abort(); }
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
/* Generated stub for wallet_transaction_locate */
|
|
|
|
struct txlocator *wallet_transaction_locate(const tal_t *ctx UNNEEDED, struct wallet *w UNNEEDED,
|
|
|
|
const struct bitcoin_txid *txid UNNEEDED)
|
|
|
|
{ fprintf(stderr, "wallet_transaction_locate called!\n"); abort(); }
|
|
|
|
/* Generated stub for watch_txid */
|
|
|
|
struct txwatch *watch_txid(const tal_t *ctx UNNEEDED,
|
|
|
|
struct chain_topology *topo UNNEEDED,
|
|
|
|
struct channel *channel UNNEEDED,
|
|
|
|
const struct bitcoin_txid *txid UNNEEDED,
|
|
|
|
enum watch_result (*cb)(struct lightningd *ld UNNEEDED,
|
|
|
|
struct channel *channel UNNEEDED,
|
|
|
|
const struct bitcoin_txid * UNNEEDED,
|
2019-06-28 03:58:31 +02:00
|
|
|
const struct bitcoin_tx * UNNEEDED,
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
unsigned int depth))
|
|
|
|
{ fprintf(stderr, "watch_txid called!\n"); abort(); }
|
|
|
|
/* Generated stub for watch_txo */
|
|
|
|
struct txowatch *watch_txo(const tal_t *ctx UNNEEDED,
|
|
|
|
struct chain_topology *topo UNNEEDED,
|
|
|
|
struct channel *channel UNNEEDED,
|
|
|
|
const struct bitcoin_txid *txid UNNEEDED,
|
|
|
|
unsigned int output UNNEEDED,
|
|
|
|
enum watch_result (*cb)(struct channel *channel UNNEEDED,
|
|
|
|
const struct bitcoin_tx *tx UNNEEDED,
|
|
|
|
size_t input_num UNNEEDED,
|
|
|
|
const struct block *block))
|
|
|
|
{ fprintf(stderr, "watch_txo called!\n"); abort(); }
|
|
|
|
/* AUTOGENERATED MOCKS END */
|
|
|
|
|
|
|
|
#if DEVELOPER
|
|
|
|
/* Generated stub for dev_disconnect_permanent */
|
|
|
|
bool dev_disconnect_permanent(struct lightningd *ld UNNEEDED)
|
|
|
|
{ fprintf(stderr, "dev_disconnect_permanent called!\n"); abort(); }
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static void add_inchan(struct route_info **inchans, int n)
|
|
|
|
{
|
2019-01-15 04:51:27 +01:00
|
|
|
struct route_info r;
|
|
|
|
memset(&r.pubkey, n, sizeof(r.pubkey));
|
|
|
|
memset(&r.short_channel_id, n, sizeof(r.short_channel_id));
|
|
|
|
r.fee_base_msat = r.fee_proportional_millionths = r.cltv_expiry_delta
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
= n;
|
2019-01-15 04:51:27 +01:00
|
|
|
tal_arr_expand(inchans, r);
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void add_peer(struct lightningd *ld, int n, enum channel_state state,
|
|
|
|
bool connected)
|
|
|
|
{
|
|
|
|
struct peer *peer = tal(ld, struct peer);
|
|
|
|
struct channel *c = tal(peer, struct channel);
|
|
|
|
|
|
|
|
memset(&peer->id, n, sizeof(peer->id));
|
|
|
|
list_head_init(&peer->channels);
|
|
|
|
list_add_tail(&ld->peers, &peer->list);
|
|
|
|
|
|
|
|
c->state = state;
|
|
|
|
c->owner = connected ? (void *)peer : NULL;
|
|
|
|
/* Channel has incoming capacity n*1000 - 1 millisatoshi */
|
2019-02-21 04:45:55 +01:00
|
|
|
c->funding.satoshis = n+1;
|
|
|
|
c->our_msat = AMOUNT_MSAT(1);
|
|
|
|
c->our_config.channel_reserve = AMOUNT_SAT(1);
|
2019-04-09 17:35:28 +02:00
|
|
|
c->channel_info.their_config.channel_reserve = AMOUNT_SAT(0);
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
list_add_tail(&peer->channels, &c->list);
|
|
|
|
}
|
|
|
|
|
2019-04-08 11:58:32 +02:00
|
|
|
/* There *is* padding in this structure, after pubkey and after cltv_expiry_delta. */
|
|
|
|
STRUCTEQ_DEF(route_info,
|
|
|
|
ALIGNOF(struct short_channel_id) - 1 - sizeof(u16),
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
pubkey,
|
2019-04-08 11:58:32 +02:00
|
|
|
cltv_expiry_delta,
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
short_channel_id,
|
|
|
|
fee_base_msat,
|
2019-04-08 11:58:32 +02:00
|
|
|
fee_proportional_millionths);
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
struct lightningd *ld;
|
|
|
|
bool any_offline;
|
|
|
|
struct route_info *inchans;
|
2019-12-17 07:11:08 +01:00
|
|
|
bool *deadends;
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
struct route_info **ret;
|
|
|
|
size_t n;
|
|
|
|
|
|
|
|
setup_locale();
|
|
|
|
secp256k1_ctx = secp256k1_context_create(SECP256K1_CONTEXT_VERIFY
|
|
|
|
| SECP256K1_CONTEXT_SIGN);
|
|
|
|
setup_tmpctx();
|
|
|
|
ld = tal(tmpctx, struct lightningd);
|
|
|
|
|
|
|
|
list_head_init(&ld->peers);
|
|
|
|
|
|
|
|
inchans = tal_arr(tmpctx, struct route_info, 0);
|
2019-12-17 07:11:08 +01:00
|
|
|
deadends = tal_arrz(tmpctx, bool, 100);
|
|
|
|
|
2019-04-09 17:35:28 +02:00
|
|
|
/* 1. Nothing to choose from -> NULL result. */
|
2019-12-17 07:11:08 +01:00
|
|
|
assert(select_inchan(tmpctx, ld, AMOUNT_MSAT(0), inchans, deadends, &any_offline) == NULL);
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
assert(any_offline == false);
|
|
|
|
|
2019-04-09 17:35:28 +02:00
|
|
|
/* 2. inchan but no corresponding peer -> NULL result. */
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
add_inchan(&inchans, 0);
|
2019-12-17 07:11:08 +01:00
|
|
|
assert(select_inchan(tmpctx, ld, AMOUNT_MSAT(0), inchans, deadends, &any_offline) == NULL);
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
assert(any_offline == false);
|
|
|
|
|
2019-04-09 17:35:28 +02:00
|
|
|
/* 3. inchan but its peer in awaiting lockin -> NULL result. */
|
|
|
|
add_peer(ld, 0, CHANNELD_AWAITING_LOCKIN, true);
|
2019-12-17 07:11:08 +01:00
|
|
|
assert(select_inchan(tmpctx, ld, AMOUNT_MSAT(0), inchans, deadends, &any_offline) == NULL);
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
assert(any_offline == false);
|
|
|
|
|
2019-04-09 17:35:28 +02:00
|
|
|
/* 4. connected peer but no corresponding inchan -> NULL result. */
|
|
|
|
add_peer(ld, 1, CHANNELD_NORMAL, true);
|
2019-12-17 07:11:08 +01:00
|
|
|
assert(select_inchan(tmpctx, ld, AMOUNT_MSAT(0), inchans, deadends, &any_offline) == NULL);
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
assert(any_offline == false);
|
|
|
|
|
2019-04-09 17:35:28 +02:00
|
|
|
/* 5. inchan but its peer (replaced with one) offline -> NULL result. */
|
|
|
|
list_del_from(&ld->peers, &list_tail(&ld->peers, struct peer, list)->list);
|
|
|
|
add_peer(ld, 1, CHANNELD_NORMAL, false);
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
add_inchan(&inchans, 1);
|
2019-12-17 07:11:08 +01:00
|
|
|
assert(select_inchan(tmpctx, ld, AMOUNT_MSAT(0), inchans, deadends, &any_offline) == NULL);
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
assert(any_offline == true);
|
|
|
|
|
2019-04-09 17:35:28 +02:00
|
|
|
/* 6. Finally, a correct peer! */
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
add_inchan(&inchans, 2);
|
|
|
|
add_peer(ld, 2, CHANNELD_NORMAL, true);
|
|
|
|
|
2019-12-17 07:11:08 +01:00
|
|
|
ret = select_inchan(tmpctx, ld, AMOUNT_MSAT(0), inchans, deadends, &any_offline);
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
assert(tal_count(ret) == 1);
|
|
|
|
assert(tal_count(ret[0]) == 1);
|
2019-04-09 17:35:28 +02:00
|
|
|
assert(any_offline == true); /* Peer 1 is offline */
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
assert(route_info_eq(ret[0], &inchans[2]));
|
|
|
|
|
2019-04-09 17:35:28 +02:00
|
|
|
/* 7. Correct peer with just enough capacity_to_pay_us */
|
2019-12-17 07:11:08 +01:00
|
|
|
ret = select_inchan(tmpctx, ld, AMOUNT_MSAT(1999), inchans, deadends, &any_offline);
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
assert(tal_count(ret) == 1);
|
|
|
|
assert(tal_count(ret[0]) == 1);
|
|
|
|
assert(any_offline == false); /* Other candidate insufficient funds. */
|
|
|
|
assert(route_info_eq(ret[0], &inchans[2]));
|
|
|
|
|
2019-04-09 17:35:28 +02:00
|
|
|
/* 8. Not if we ask for too much! Our balance is 1msat. */
|
2019-12-17 07:11:08 +01:00
|
|
|
ret = select_inchan(tmpctx, ld, AMOUNT_MSAT(2000), inchans, deadends, &any_offline);
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
assert(ret == NULL);
|
|
|
|
assert(any_offline == false); /* Other candidate insufficient funds. */
|
|
|
|
|
2019-04-09 17:35:28 +02:00
|
|
|
/* 9. Add another peer */
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
add_inchan(&inchans, 3);
|
|
|
|
add_peer(ld, 3, CHANNELD_NORMAL, true);
|
|
|
|
|
2019-04-09 17:35:28 +02:00
|
|
|
/* Simulate selection ratios between excesses 25% and 50% of capacity*/
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
for (size_t i = n = 0; i < 1000; i++) {
|
2019-12-17 07:11:08 +01:00
|
|
|
ret = select_inchan(tmpctx, ld, AMOUNT_MSAT(1499), inchans, deadends, &any_offline);
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
assert(tal_count(ret) == 1);
|
|
|
|
assert(tal_count(ret[0]) == 1);
|
|
|
|
assert(any_offline == false); /* Other candidate insufficient funds. */
|
|
|
|
assert(route_info_eq(ret[0], &inchans[2])
|
|
|
|
|| route_info_eq(ret[0], &inchans[3]));
|
|
|
|
n += route_info_eq(ret[0], &inchans[2]);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Handwave over probability of this happening! Within 20% */
|
2019-04-09 17:35:28 +02:00
|
|
|
printf("Number of selections with excess 25 percent of capacity: %zu\n"
|
|
|
|
"Number of selections with excess 50 percent of capacity: %zu\n",
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
n, 1000 - n);
|
2019-04-09 17:35:28 +02:00
|
|
|
assert(n > 333 - 66 && n < 333 + 66);
|
|
|
|
|
|
|
|
/* 10. Last peer's capacity goes from 3 to 2 sat*/
|
|
|
|
list_tail(&list_tail(&ld->peers, struct peer, list)->channels, struct channel, list)->
|
|
|
|
channel_info.their_config.channel_reserve = AMOUNT_SAT(1);
|
2019-12-17 07:11:08 +01:00
|
|
|
ret = select_inchan(tmpctx, ld, AMOUNT_MSAT(1499), inchans, deadends, &any_offline);
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
|
2019-04-09 17:35:28 +02:00
|
|
|
/* Simulate selection ratios between excesses 25% and 75% of capacity*/
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
for (size_t i = n = 0; i < 1000; i++) {
|
2019-12-17 07:11:08 +01:00
|
|
|
ret = select_inchan(tmpctx, ld, AMOUNT_MSAT(1499), inchans, deadends, &any_offline);
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
assert(tal_count(ret) == 1);
|
|
|
|
assert(tal_count(ret[0]) == 1);
|
|
|
|
assert(any_offline == false); /* Other candidate insufficient funds. */
|
|
|
|
assert(route_info_eq(ret[0], &inchans[2])
|
|
|
|
|| route_info_eq(ret[0], &inchans[3]));
|
|
|
|
n += route_info_eq(ret[0], &inchans[2]);
|
|
|
|
}
|
|
|
|
|
2019-04-09 17:35:28 +02:00
|
|
|
/* Handwave over probability of this happening! Within 20% */
|
|
|
|
printf("Number of selections with excess 25 percent of capacity: %zu\n"
|
|
|
|
"Number of selections with excess 75 percent of capacity: %zu\n",
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
n, 1000 - n);
|
2019-04-09 17:35:28 +02:00
|
|
|
assert(n > 250 - 50 && n < 250 + 50);
|
json-invoice: add routeboost, warnings.
We split json_invoice(), as it now needs to round-trip to the gossipd,
and uniqueness checks need to happen *after* gossipd replies to avoid
a race.
For every candidate channel gossipd gives us, we check that it's in
state NORMAL (not shutting down, not still waiting for lockin), that
it's connected, and that it has capacity. We then choose one with
probability weighted by excess capacity, so larger channels are more
likely.
As a side effect of this, we can tell if an invoice is unpayble (no
channels have sufficient incoming capacity) or difficuly (no *online*
channels have sufficient capacity), so we add those warnings.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-27 07:29:17 +02:00
|
|
|
|
|
|
|
/* No memory leaks please */
|
|
|
|
secp256k1_context_destroy(secp256k1_ctx);
|
|
|
|
tal_free(tmpctx);
|
|
|
|
|
|
|
|
/* FIXME: Do BOLT comparison! */
|
|
|
|
return 0;
|
|
|
|
}
|