2017-08-31 03:08:12 +01:00
|
|
|
#include "../routing.c"
|
2018-03-18 14:01:22 +00:00
|
|
|
#include "../gossip_store.c"
|
2020-02-27 02:17:01 +00:00
|
|
|
#include <common/json_stream.h>
|
2018-02-05 04:09:27 +00:00
|
|
|
#include <stdio.h>
|
2017-08-31 03:08:12 +01:00
|
|
|
|
2019-11-17 11:42:33 +00:00
|
|
|
void status_fmt(enum log_level level UNUSED,
|
|
|
|
const struct node_id *node_id,
|
|
|
|
const char *fmt, ...)
|
2018-02-05 04:09:27 +00:00
|
|
|
{
|
|
|
|
va_list ap;
|
|
|
|
|
|
|
|
va_start(ap, fmt);
|
|
|
|
vprintf(fmt, ap);
|
|
|
|
printf("\n");
|
|
|
|
va_end(ap);
|
|
|
|
}
|
|
|
|
|
2017-08-31 03:08:12 +01:00
|
|
|
/* AUTOGENERATED MOCKS START */
|
2019-09-16 11:44:00 +01:00
|
|
|
/* Generated stub for cupdate_different */
|
|
|
|
bool cupdate_different(struct gossip_store *gs UNNEEDED,
|
|
|
|
const struct half_chan *hc UNNEEDED,
|
|
|
|
const u8 *cupdate UNNEEDED)
|
|
|
|
{ fprintf(stderr, "cupdate_different called!\n"); abort(); }
|
2020-01-26 12:07:50 +00: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(); }
|
2019-05-04 06:53:12 +01:00
|
|
|
/* Generated stub for fromwire_gossip_store_channel_amount */
|
|
|
|
bool fromwire_gossip_store_channel_amount(const void *p UNNEEDED, struct amount_sat *satoshis UNNEEDED)
|
|
|
|
{ fprintf(stderr, "fromwire_gossip_store_channel_amount called!\n"); abort(); }
|
2019-06-03 19:05:25 +01:00
|
|
|
/* Generated stub for fromwire_gossip_store_private_update */
|
|
|
|
bool fromwire_gossip_store_private_update(const tal_t *ctx UNNEEDED, const void *p UNNEEDED, u8 **update UNNEEDED)
|
|
|
|
{ fprintf(stderr, "fromwire_gossip_store_private_update called!\n"); abort(); }
|
2020-03-10 16:54:09 +00:00
|
|
|
/* Generated stub for fromwire_gossipd_local_add_channel */
|
2020-05-04 01:17:49 +01:00
|
|
|
bool fromwire_gossipd_local_add_channel(const tal_t *ctx UNNEEDED, const void *p UNNEEDED, struct short_channel_id *short_channel_id UNNEEDED, struct node_id *remote_node_id UNNEEDED, struct amount_sat *satoshis UNNEEDED, u8 **features UNNEEDED)
|
2020-03-10 16:54:09 +00:00
|
|
|
{ fprintf(stderr, "fromwire_gossipd_local_add_channel called!\n"); abort(); }
|
2017-10-23 05:17:38 +01:00
|
|
|
/* Generated stub for fromwire_wireaddr */
|
|
|
|
bool fromwire_wireaddr(const u8 **cursor UNNEEDED, size_t *max UNNEEDED, struct wireaddr *addr UNNEEDED)
|
|
|
|
{ fprintf(stderr, "fromwire_wireaddr called!\n"); abort(); }
|
2020-01-26 12:07:50 +00:00
|
|
|
/* Generated stub for json_add_member */
|
|
|
|
void json_add_member(struct json_stream *js UNNEEDED,
|
|
|
|
const char *fieldname UNNEEDED,
|
|
|
|
bool quote UNNEEDED,
|
|
|
|
const char *fmt UNNEEDED, ...)
|
|
|
|
{ fprintf(stderr, "json_add_member called!\n"); abort(); }
|
|
|
|
/* Generated stub for json_array_end */
|
|
|
|
void json_array_end(struct json_stream *js UNNEEDED)
|
|
|
|
{ fprintf(stderr, "json_array_end called!\n"); abort(); }
|
|
|
|
/* Generated stub for json_array_start */
|
|
|
|
void json_array_start(struct json_stream *js UNNEEDED, const char *fieldname UNNEEDED)
|
|
|
|
{ fprintf(stderr, "json_array_start called!\n"); abort(); }
|
|
|
|
/* 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(); }
|
|
|
|
/* Generated stub for json_object_end */
|
|
|
|
void json_object_end(struct json_stream *js UNNEEDED)
|
|
|
|
{ fprintf(stderr, "json_object_end called!\n"); abort(); }
|
|
|
|
/* Generated stub for json_object_start */
|
|
|
|
void json_object_start(struct json_stream *ks UNNEEDED, const char *fieldname UNNEEDED)
|
|
|
|
{ fprintf(stderr, "json_object_start called!\n"); abort(); }
|
2019-09-06 05:42:05 +01:00
|
|
|
/* Generated stub for memleak_add_helper_ */
|
|
|
|
void memleak_add_helper_(const tal_t *p UNNEEDED, void (*cb)(struct htable *memtable UNNEEDED,
|
|
|
|
const tal_t *)){ }
|
2019-09-16 11:44:00 +01:00
|
|
|
/* Generated stub for nannounce_different */
|
|
|
|
bool nannounce_different(struct gossip_store *gs UNNEEDED,
|
|
|
|
const struct node *node UNNEEDED,
|
|
|
|
const u8 *nannounce UNNEEDED)
|
|
|
|
{ fprintf(stderr, "nannounce_different called!\n"); abort(); }
|
2019-10-15 03:39:13 +01:00
|
|
|
/* Generated stub for notleak_ */
|
|
|
|
void *notleak_(const void *ptr UNNEEDED, bool plus_children UNNEEDED)
|
|
|
|
{ fprintf(stderr, "notleak_ called!\n"); abort(); }
|
2018-01-17 23:32:36 +00:00
|
|
|
/* Generated stub for onion_type_name */
|
|
|
|
const char *onion_type_name(int e UNNEEDED)
|
|
|
|
{ fprintf(stderr, "onion_type_name called!\n"); abort(); }
|
2019-10-08 02:13:24 +01:00
|
|
|
/* Generated stub for peer_supplied_good_gossip */
|
2019-10-08 02:26:24 +01:00
|
|
|
void peer_supplied_good_gossip(struct peer *peer UNNEEDED, size_t amount UNNEEDED)
|
2019-10-08 02:13:24 +01:00
|
|
|
{ fprintf(stderr, "peer_supplied_good_gossip called!\n"); abort(); }
|
2018-03-08 04:10:29 +00:00
|
|
|
/* Generated stub for sanitize_error */
|
|
|
|
char *sanitize_error(const tal_t *ctx UNNEEDED, const u8 *errmsg UNNEEDED,
|
|
|
|
struct channel_id *channel_id UNNEEDED)
|
|
|
|
{ fprintf(stderr, "sanitize_error called!\n"); abort(); }
|
2017-12-22 01:10:00 +00:00
|
|
|
/* Generated stub for status_failed */
|
2018-02-08 01:25:12 +00:00
|
|
|
void status_failed(enum status_failreason code UNNEEDED,
|
|
|
|
const char *fmt UNNEEDED, ...)
|
2017-12-22 01:10:00 +00:00
|
|
|
{ fprintf(stderr, "status_failed called!\n"); abort(); }
|
2018-03-08 04:10:26 +00:00
|
|
|
/* 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(); }
|
2019-05-04 06:53:12 +01:00
|
|
|
/* Generated stub for towire_gossip_store_channel_amount */
|
|
|
|
u8 *towire_gossip_store_channel_amount(const tal_t *ctx UNNEEDED, struct amount_sat satoshis UNNEEDED)
|
|
|
|
{ fprintf(stderr, "towire_gossip_store_channel_amount called!\n"); abort(); }
|
2019-06-03 19:05:25 +01:00
|
|
|
/* Generated stub for towire_gossip_store_private_update */
|
|
|
|
u8 *towire_gossip_store_private_update(const tal_t *ctx UNNEEDED, const u8 *update UNNEEDED)
|
|
|
|
{ fprintf(stderr, "towire_gossip_store_private_update called!\n"); abort(); }
|
2019-04-11 06:16:57 +01:00
|
|
|
/* Generated stub for update_peers_broadcast_index */
|
|
|
|
void update_peers_broadcast_index(struct list_head *peers UNNEEDED, u32 offset UNNEEDED)
|
|
|
|
{ fprintf(stderr, "update_peers_broadcast_index called!\n"); abort(); }
|
2017-08-31 03:08:12 +01:00
|
|
|
/* AUTOGENERATED MOCKS END */
|
|
|
|
|
2018-11-21 22:41:49 +00:00
|
|
|
#if DEVELOPER
|
|
|
|
/* Generated stub for memleak_remove_htable */
|
|
|
|
void memleak_remove_htable(struct htable *memtable UNNEEDED, const struct htable *ht UNNEEDED)
|
|
|
|
{ fprintf(stderr, "memleak_remove_htable called!\n"); abort(); }
|
|
|
|
/* Generated stub for memleak_remove_intmap_ */
|
|
|
|
void memleak_remove_intmap_(struct htable *memtable UNNEEDED, const struct intmap *m UNNEEDED)
|
|
|
|
{ fprintf(stderr, "memleak_remove_intmap_ called!\n"); abort(); }
|
|
|
|
#endif
|
|
|
|
|
2019-09-27 01:04:34 +01:00
|
|
|
/* NOOP 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)
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2019-04-08 10:58:32 +01:00
|
|
|
static void node_id_from_privkey(const struct privkey *p, struct node_id *id)
|
|
|
|
{
|
|
|
|
struct pubkey k;
|
|
|
|
pubkey_from_privkey(p, &k);
|
|
|
|
node_id_from_pubkey(id, &k);
|
|
|
|
}
|
|
|
|
|
2017-09-01 05:18:55 +01:00
|
|
|
/* Updates existing route if required. */
|
2018-06-29 12:07:18 +01:00
|
|
|
static void add_connection(struct routing_state *rstate,
|
2019-04-08 10:58:32 +01:00
|
|
|
const struct node_id *from,
|
|
|
|
const struct node_id *to,
|
2017-09-01 05:18:55 +01:00
|
|
|
u32 base_fee, s32 proportional_fee,
|
|
|
|
u32 delay)
|
|
|
|
{
|
2018-03-02 08:59:16 +00:00
|
|
|
struct short_channel_id scid;
|
2018-03-04 02:26:59 +00:00
|
|
|
struct half_chan *c;
|
|
|
|
struct chan *chan;
|
2019-02-21 03:45:55 +00:00
|
|
|
struct amount_sat satoshis = AMOUNT_SAT(100000);
|
2018-03-02 08:59:16 +00:00
|
|
|
|
2018-03-02 08:59:17 +00:00
|
|
|
/* Make a unique scid. */
|
|
|
|
memcpy(&scid, from, sizeof(scid) / 2);
|
|
|
|
memcpy((char *)&scid + sizeof(scid) / 2, to, sizeof(scid) / 2);
|
|
|
|
|
|
|
|
chan = get_channel(rstate, &scid);
|
|
|
|
if (!chan)
|
2018-09-22 01:34:03 +01:00
|
|
|
chan = new_chan(rstate, &scid, from, to, satoshis);
|
2018-07-30 14:31:45 +01:00
|
|
|
|
2019-04-08 10:58:32 +01:00
|
|
|
c = &chan->half[node_id_idx(from, to)];
|
2019-04-11 06:16:30 +01:00
|
|
|
/* Make sure it's seen as initialized (index non-zero). */
|
|
|
|
c->bcast.index = 1;
|
2017-09-01 05:18:55 +01:00
|
|
|
c->base_fee = base_fee;
|
|
|
|
c->proportional_fee = proportional_fee;
|
|
|
|
c->delay = delay;
|
2019-04-08 10:58:32 +01:00
|
|
|
c->channel_flags = node_id_idx(from, to);
|
2019-02-21 03:45:55 +00:00
|
|
|
c->htlc_minimum = AMOUNT_MSAT(0);
|
|
|
|
c->htlc_maximum = AMOUNT_MSAT(100000 * 1000);
|
2017-09-01 05:18:55 +01:00
|
|
|
}
|
|
|
|
|
2018-03-04 02:26:59 +00:00
|
|
|
/* Returns chan connecting from and to: *idx set to refer
|
2018-03-02 08:59:17 +00:00
|
|
|
* to connection with src=from, dst=to */
|
2018-03-05 16:40:50 +00:00
|
|
|
static struct chan *find_channel(struct routing_state *rstate UNUSED,
|
2018-03-02 08:59:17 +00:00
|
|
|
const struct node *from,
|
|
|
|
const struct node *to,
|
|
|
|
int *idx)
|
|
|
|
{
|
2019-04-08 00:51:30 +01:00
|
|
|
struct chan_map_iter i;
|
|
|
|
struct chan *c;
|
2018-03-02 08:59:17 +00:00
|
|
|
|
2019-04-08 10:58:32 +01:00
|
|
|
*idx = node_id_idx(&from->id, &to->id);
|
2018-03-02 08:59:17 +00:00
|
|
|
|
2019-04-08 05:42:43 +01:00
|
|
|
for (c = first_chan(to, &i); c; c = next_chan(to, &i)) {
|
2019-04-08 00:51:30 +01:00
|
|
|
if (c->nodes[*idx] == from)
|
|
|
|
return c;
|
2018-03-02 08:59:17 +00:00
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2018-03-04 02:26:59 +00:00
|
|
|
static struct half_chan *get_connection(struct routing_state *rstate,
|
2019-04-08 10:58:32 +01:00
|
|
|
const struct node_id *from_id,
|
|
|
|
const struct node_id *to_id)
|
2018-03-02 08:59:17 +00:00
|
|
|
{
|
|
|
|
int idx;
|
|
|
|
struct node *from, *to;
|
2018-03-04 02:26:59 +00:00
|
|
|
struct chan *c;
|
2018-03-02 08:59:17 +00:00
|
|
|
|
|
|
|
from = get_node(rstate, from_id);
|
|
|
|
to = get_node(rstate, to_id);
|
|
|
|
if (!from || ! to)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
c = find_channel(rstate, from, to, &idx);
|
|
|
|
if (!c)
|
|
|
|
return NULL;
|
2018-03-04 02:26:59 +00:00
|
|
|
return &c->half[idx];
|
2018-03-02 08:59:17 +00:00
|
|
|
}
|
|
|
|
|
2018-03-04 02:26:59 +00:00
|
|
|
static bool channel_is_between(const struct chan *chan,
|
2019-04-08 10:58:32 +01:00
|
|
|
const struct node_id *a, const struct node_id *b)
|
2018-03-04 02:23:32 +00:00
|
|
|
{
|
2019-04-08 10:58:32 +01:00
|
|
|
if (node_id_eq(&chan->nodes[0]->id, a)
|
|
|
|
&& node_id_eq(&chan->nodes[1]->id, b))
|
2018-03-04 02:23:32 +00:00
|
|
|
return true;
|
|
|
|
|
2019-04-08 10:58:32 +01:00
|
|
|
if (node_id_eq(&chan->nodes[0]->id, b)
|
|
|
|
&& node_id_eq(&chan->nodes[1]->id, a))
|
2018-03-04 02:23:32 +00:00
|
|
|
return true;
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-08-31 03:08:12 +01:00
|
|
|
int main(void)
|
|
|
|
{
|
2018-04-25 11:55:34 +01:00
|
|
|
setup_locale();
|
|
|
|
|
2017-08-31 03:08:12 +01:00
|
|
|
struct routing_state *rstate;
|
2019-04-08 10:58:32 +01:00
|
|
|
struct node_id a, b, c, d;
|
2017-08-31 03:08:12 +01:00
|
|
|
struct privkey tmp;
|
2019-02-21 03:45:55 +00:00
|
|
|
struct amount_msat fee;
|
2018-03-04 02:26:59 +00:00
|
|
|
struct chan **route;
|
2017-12-18 04:15:41 +00:00
|
|
|
const double riskfactor = 1.0 / BLOCKS_PER_YEAR / 10000;
|
2017-08-31 03:08:12 +01:00
|
|
|
|
|
|
|
secp256k1_ctx = secp256k1_context_create(SECP256K1_CONTEXT_VERIFY
|
|
|
|
| SECP256K1_CONTEXT_SIGN);
|
2018-03-15 06:10:20 +00:00
|
|
|
setup_tmpctx();
|
2017-08-31 03:08:12 +01:00
|
|
|
|
|
|
|
memset(&tmp, 'a', sizeof(tmp));
|
2019-04-08 10:58:32 +01:00
|
|
|
node_id_from_privkey(&tmp, &a);
|
2019-11-20 01:54:47 +00:00
|
|
|
rstate = new_routing_state(tmpctx, &a, NULL, NULL, NULL, false, false);
|
2017-12-02 22:28:19 +00:00
|
|
|
|
2017-09-01 05:18:55 +01:00
|
|
|
new_node(rstate, &a);
|
2017-08-31 03:08:12 +01:00
|
|
|
|
|
|
|
memset(&tmp, 'b', sizeof(tmp));
|
2019-04-08 10:58:32 +01:00
|
|
|
node_id_from_privkey(&tmp, &b);
|
2017-09-01 05:18:55 +01:00
|
|
|
new_node(rstate, &b);
|
2017-08-31 03:08:12 +01:00
|
|
|
|
|
|
|
/* A<->B */
|
2017-09-01 05:18:55 +01:00
|
|
|
add_connection(rstate, &a, &b, 1, 1, 1);
|
2017-08-31 03:08:12 +01:00
|
|
|
|
2019-02-21 03:45:55 +00:00
|
|
|
route = find_route(tmpctx, rstate, &a, &b, AMOUNT_MSAT(1000), riskfactor, 0.0, NULL,
|
2019-01-15 04:06:27 +00:00
|
|
|
ROUTING_MAX_HOPS, &fee);
|
2018-04-14 21:52:35 +01:00
|
|
|
assert(route);
|
2018-03-04 02:26:54 +00:00
|
|
|
assert(tal_count(route) == 1);
|
2019-02-21 03:45:55 +00:00
|
|
|
assert(amount_msat_eq(fee, AMOUNT_MSAT(0)));
|
2017-08-31 03:08:12 +01:00
|
|
|
|
|
|
|
/* A<->B<->C */
|
|
|
|
memset(&tmp, 'c', sizeof(tmp));
|
2019-04-08 10:58:32 +01:00
|
|
|
node_id_from_privkey(&tmp, &c);
|
2017-09-01 05:18:55 +01:00
|
|
|
new_node(rstate, &c);
|
2017-08-31 03:08:12 +01:00
|
|
|
|
2019-09-08 17:39:26 +01:00
|
|
|
status_debug("A = %s", type_to_string(tmpctx, struct node_id, &a));
|
|
|
|
status_debug("B = %s", type_to_string(tmpctx, struct node_id, &b));
|
|
|
|
status_debug("C = %s", type_to_string(tmpctx, struct node_id, &c));
|
2017-09-01 05:18:55 +01:00
|
|
|
add_connection(rstate, &b, &c, 1, 1, 1);
|
2017-08-31 03:08:12 +01:00
|
|
|
|
2019-02-21 03:45:55 +00:00
|
|
|
route = find_route(tmpctx, rstate, &a, &c, AMOUNT_MSAT(1000), riskfactor, 0.0, NULL,
|
2019-01-15 04:06:27 +00:00
|
|
|
ROUTING_MAX_HOPS, &fee);
|
2018-04-14 21:52:35 +01:00
|
|
|
assert(route);
|
2018-03-04 02:26:54 +00:00
|
|
|
assert(tal_count(route) == 2);
|
2019-02-21 03:45:55 +00:00
|
|
|
assert(amount_msat_eq(fee, AMOUNT_MSAT(1)));
|
2017-08-31 03:08:12 +01:00
|
|
|
|
|
|
|
/* A<->D<->C: Lower base, higher percentage. */
|
|
|
|
memset(&tmp, 'd', sizeof(tmp));
|
2019-04-08 10:58:32 +01:00
|
|
|
node_id_from_privkey(&tmp, &d);
|
2017-09-01 05:18:55 +01:00
|
|
|
new_node(rstate, &d);
|
2019-09-08 17:39:26 +01:00
|
|
|
status_debug("D = %s", type_to_string(tmpctx, struct node_id, &d));
|
2017-08-31 03:08:12 +01:00
|
|
|
|
2017-09-01 05:18:55 +01:00
|
|
|
add_connection(rstate, &a, &d, 0, 2, 1);
|
|
|
|
add_connection(rstate, &d, &c, 0, 2, 1);
|
2017-08-31 03:08:12 +01:00
|
|
|
|
|
|
|
/* Will go via D for small amounts. */
|
2019-02-21 03:45:55 +00:00
|
|
|
route = find_route(tmpctx, rstate, &a, &c, AMOUNT_MSAT(1000), riskfactor, 0.0, NULL,
|
2019-01-15 04:06:27 +00:00
|
|
|
ROUTING_MAX_HOPS, &fee);
|
2018-04-14 21:52:35 +01:00
|
|
|
assert(route);
|
2018-03-04 02:26:54 +00:00
|
|
|
assert(tal_count(route) == 2);
|
|
|
|
assert(channel_is_between(route[0], &a, &d));
|
|
|
|
assert(channel_is_between(route[1], &d, &c));
|
2019-02-21 03:45:55 +00:00
|
|
|
assert(amount_msat_eq(fee, AMOUNT_MSAT(0)));
|
2017-08-31 03:08:12 +01:00
|
|
|
|
|
|
|
/* Will go via B for large amounts. */
|
2019-02-21 03:45:55 +00:00
|
|
|
route = find_route(tmpctx, rstate, &a, &c, AMOUNT_MSAT(3000000), riskfactor, 0.0, NULL,
|
2019-01-15 04:06:27 +00:00
|
|
|
ROUTING_MAX_HOPS, &fee);
|
2018-04-14 21:52:35 +01:00
|
|
|
assert(route);
|
2018-03-04 02:26:54 +00:00
|
|
|
assert(tal_count(route) == 2);
|
|
|
|
assert(channel_is_between(route[0], &a, &b));
|
|
|
|
assert(channel_is_between(route[1], &b, &c));
|
2019-02-21 03:45:55 +00:00
|
|
|
assert(amount_msat_eq(fee, AMOUNT_MSAT(1 + 3)));
|
2017-09-01 05:18:38 +01:00
|
|
|
|
|
|
|
/* Make B->C inactive, force it back via D */
|
2018-09-20 01:59:46 +01:00
|
|
|
get_connection(rstate, &b, &c)->channel_flags |= ROUTING_FLAGS_DISABLED;
|
2019-02-21 03:45:55 +00:00
|
|
|
route = find_route(tmpctx, rstate, &a, &c, AMOUNT_MSAT(3000000), riskfactor, 0.0, NULL,
|
2019-01-15 04:06:27 +00:00
|
|
|
ROUTING_MAX_HOPS, &fee);
|
2018-04-14 21:52:35 +01:00
|
|
|
assert(route);
|
2018-03-04 02:26:54 +00:00
|
|
|
assert(tal_count(route) == 2);
|
|
|
|
assert(channel_is_between(route[0], &a, &d));
|
|
|
|
assert(channel_is_between(route[1], &d, &c));
|
2019-02-21 03:45:55 +00:00
|
|
|
assert(amount_msat_eq(fee, AMOUNT_MSAT(0 + 6)));
|
2017-08-31 03:08:12 +01:00
|
|
|
|
2018-03-15 06:10:20 +00:00
|
|
|
tal_free(tmpctx);
|
2017-09-01 05:18:54 +01:00
|
|
|
secp256k1_context_destroy(secp256k1_ctx);
|
2017-08-31 03:08:12 +01:00
|
|
|
return 0;
|
|
|
|
}
|