From dffbf8de853a0a01c8e2852cf98799ab7008acfc Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 25 Aug 2020 11:35:45 +0930 Subject: [PATCH] gossipd: convert wire to new scheme. Signed-off-by: Rusty Russell --- channeld/Makefile | 2 +- channeld/channeld.c | 2 +- closingd/Makefile | 2 +- closingd/closingd.c | 2 +- common/read_peer_msg.c | 2 +- connectd/Makefile | 2 +- connectd/connectd.c | 2 +- devtools/Makefile | 8 +- devtools/create-gossipstore.c | 2 +- devtools/dump-gossipstore.c | 4 +- gossipd/Makefile | 37 +---- gossipd/gossip_generation.c | 2 +- gossipd/gossip_store.c | 6 +- ...gossip_store.csv => gossip_store_wire.csv} | 0 gossipd/gossip_wire.csv | 140 ---------------- gossipd/gossipd.c | 154 +++++++++--------- ..._peerd_wire.csv => gossipd_peerd_wire.csv} | 0 gossipd/gossipd_wire.csv | 140 ++++++++++++++++ gossipd/queries.c | 6 +- gossipd/routing.c | 6 +- gossipd/test/run-crc32_of_update.c | 6 +- gossipd/test/run-extended-info.c | 6 +- lightningd/closing_control.c | 4 +- lightningd/gossip_control.c | 96 +++++------ lightningd/invoice.c | 6 +- lightningd/memdump.c | 6 +- lightningd/pay.c | 4 +- lightningd/peer_htlcs.c | 6 +- lightningd/ping.c | 6 +- lightningd/signmessage.c | 6 +- lightningd/test/run-invoice-select-inchan.c | 12 +- openingd/Makefile | 2 +- openingd/openingd.c | 2 +- wallet/test/run-wallet.c | 12 +- 34 files changed, 337 insertions(+), 356 deletions(-) rename gossipd/{gossip_store.csv => gossip_store_wire.csv} (100%) delete mode 100644 gossipd/gossip_wire.csv rename gossipd/{gossip_peerd_wire.csv => gossipd_peerd_wire.csv} (100%) create mode 100644 gossipd/gossipd_wire.csv diff --git a/channeld/Makefile b/channeld/Makefile index 721a210f6..f31e49e1d 100644 --- a/channeld/Makefile +++ b/channeld/Makefile @@ -91,7 +91,7 @@ CHANNELD_COMMON_OBJS := \ common/version.o \ common/wire_error.o \ common/wireaddr.o \ - gossipd/gen_gossip_peerd_wire.o \ + gossipd/gossipd_peerd_wiregen.o \ lightningd/gossip_msg.o \ wire/fromwire.o \ wire/towire.o diff --git a/channeld/channeld.c b/channeld/channeld.c index 8c2ddfc8c..5f53ad561 100644 --- a/channeld/channeld.c +++ b/channeld/channeld.c @@ -56,7 +56,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/closingd/Makefile b/closingd/Makefile index e9f08739e..96f973bab 100644 --- a/closingd/Makefile +++ b/closingd/Makefile @@ -82,7 +82,7 @@ CLOSINGD_COMMON_OBJS := \ common/version.o \ common/wire_error.o \ common/wireaddr.o \ - gossipd/gen_gossip_peerd_wire.o + gossipd/gossipd_peerd_wiregen.o closingd/gen_closing_wire.h: $(WIRE_GEN) closingd/closing_wire.csv $(WIRE_GEN) --page header $@ closing_wire_type < closingd/closing_wire.csv > $@ diff --git a/closingd/closingd.c b/closingd/closingd.c index e06eaa609..49a761ba9 100644 --- a/closingd/closingd.c +++ b/closingd/closingd.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/common/read_peer_msg.c b/common/read_peer_msg.c index 6245cf69b..2427ba36b 100644 --- a/common/read_peer_msg.c +++ b/common/read_peer_msg.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/connectd/Makefile b/connectd/Makefile index aa0df2b44..96014705b 100644 --- a/connectd/Makefile +++ b/connectd/Makefile @@ -73,7 +73,7 @@ CONNECTD_COMMON_OBJS := \ common/version.o \ common/wireaddr.o \ common/wire_error.o \ - gossipd/gen_gossip_wire.o \ + gossipd/gossipd_wiregen.o \ lightningd/gossip_msg.o \ wire/gen_onion_wire.o diff --git a/connectd/connectd.c b/connectd/connectd.c index 297af2645..839ab5a1f 100644 --- a/connectd/connectd.c +++ b/connectd/connectd.c @@ -52,7 +52,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/devtools/Makefile b/devtools/Makefile index db787722f..81b620676 100644 --- a/devtools/Makefile +++ b/devtools/Makefile @@ -58,12 +58,12 @@ devtools/bolt11-cli: $(DEVTOOLS_OBJS) $(DEVTOOLS_COMMON_OBJS) $(JSMN_OBJS) $(CCA devtools/decodemsg: $(DEVTOOLS_OBJS) $(DEVTOOLS_COMMON_OBJS) $(JSMN_OBJS) $(CCAN_OBJS) $(BITCOIN_OBJS) wire/fromwire.o wire/towire.o devtools/decodemsg.o -devtools/dump-gossipstore: $(DEVTOOLS_OBJS) $(DEVTOOLS_COMMON_OBJS) $(JSMN_OBJS) $(CCAN_OBJS) $(BITCOIN_OBJS) wire/fromwire.o wire/towire.o devtools/dump-gossipstore.o gossipd/gen_gossip_store.o +devtools/dump-gossipstore: $(DEVTOOLS_OBJS) $(DEVTOOLS_COMMON_OBJS) $(JSMN_OBJS) $(CCAN_OBJS) $(BITCOIN_OBJS) wire/fromwire.o wire/towire.o devtools/dump-gossipstore.o gossipd/gossip_store_wiregen.o -devtools/dump-gossipstore.o: gossipd/gen_gossip_store.h +devtools/dump-gossipstore.o: gossipd/gossip_store_wiregen.h -devtools/create-gossipstore: $(DEVTOOLS_OBJS) $(DEVTOOLS_COMMON_OBJS) $(JSMN_OBJS) $(CCAN_OBJS) $(BITCOIN_OBJS) wire/fromwire.o wire/towire.o devtools/create-gossipstore.o gossipd/gen_gossip_store.o -devtools/create-gossipstore.o: gossipd/gen_gossip_store.h +devtools/create-gossipstore: $(DEVTOOLS_OBJS) $(DEVTOOLS_COMMON_OBJS) $(JSMN_OBJS) $(CCAN_OBJS) $(BITCOIN_OBJS) wire/fromwire.o wire/towire.o devtools/create-gossipstore.o gossipd/gossip_store_wiregen.o +devtools/create-gossipstore.o: gossipd/gossip_store_wiregen.h devtools/onion.c: ccan/config.h diff --git a/devtools/create-gossipstore.c b/devtools/create-gossipstore.c index 5cc0b0323..c132bc8cc 100644 --- a/devtools/create-gossipstore.c +++ b/devtools/create-gossipstore.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/devtools/dump-gossipstore.c b/devtools/dump-gossipstore.c index 97ca545d3..2cb54df70 100644 --- a/devtools/dump-gossipstore.c +++ b/devtools/dump-gossipstore.c @@ -5,8 +5,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/gossipd/Makefile b/gossipd/Makefile index 28fb560bc..d2dc1fdd1 100644 --- a/gossipd/Makefile +++ b/gossipd/Makefile @@ -7,14 +7,14 @@ gossipd-wrongdir: default: gossipd-all # lightningd uses this: -LIGHTNINGD_GOSSIP_CONTROL_HEADERS := gossipd/gen_gossip_wire.h -LIGHTNINGD_GOSSIP_CONTROL_SRC := gossipd/gen_gossip_wire.c +LIGHTNINGD_GOSSIP_CONTROL_HEADERS := gossipd/gossipd_wiregen.h +LIGHTNINGD_GOSSIP_CONTROL_SRC := gossipd/gossipd_wiregen.c LIGHTNINGD_GOSSIP_CONTROL_OBJS := $(LIGHTNINGD_GOSSIP_CONTROL_SRC:.c=.o) # gossipd needs these: -LIGHTNINGD_GOSSIP_HEADERS_WSRC := gossipd/gen_gossip_wire.h \ - gossipd/gen_gossip_peerd_wire.h \ - gossipd/gen_gossip_store.h \ +LIGHTNINGD_GOSSIP_HEADERS_WSRC := gossipd/gossipd_wiregen.h \ + gossipd/gossipd_peerd_wiregen.h \ + gossipd/gossip_store_wiregen.h \ gossipd/gossipd.h \ gossipd/gossip_store.h \ gossipd/queries.h \ @@ -28,11 +28,11 @@ LIGHTNINGD_GOSSIP_OBJS := $(LIGHTNINGD_GOSSIP_SRC:.c=.o) # Make sure these depend on everything. ALL_OBJS += $(LIGHTNINGD_GOSSIP_OBJS) ALL_PROGRAMS += lightningd/lightning_gossipd -ALL_GEN_HEADERS += gossipd/gen_gossip_wire.h gossipd/gen_gossip_peerd_wire.h +ALL_GEN_HEADERS += $(wildcard gossipd/*wiregen.h) # For checking -LIGHTNINGD_GOSSIP_ALLSRC_NOGEN := $(filter-out gossipd/gen_%, $(LIGHTNINGD_GOSSIP_CLIENT_SRC) $(LIGHTNINGD_GOSSIP_SRC)) -LIGHTNINGD_GOSSIP_ALLHEADERS_NOGEN := $(filter-out gossipd/gen_%, $(LIGHTNINGD_GOSSIP_CLIENT_HEADERS) $(LIGHTNINGD_GOSSIP_HEADERS)) +LIGHTNINGD_GOSSIP_ALLSRC_NOGEN := $(filter-out gossipd/%wiregen.c, $(LIGHTNINGD_GOSSIP_CLIENT_SRC) $(LIGHTNINGD_GOSSIP_SRC)) +LIGHTNINGD_GOSSIP_ALLHEADERS_NOGEN := $(filter-out gossipd/%wiregen.h, $(LIGHTNINGD_GOSSIP_CLIENT_HEADERS) $(LIGHTNINGD_GOSSIP_HEADERS)) # Add to headers which any object might need. LIGHTNINGD_HEADERS_GEN += $(LIGHTNINGD_GOSSIP_HEADERS) @@ -88,25 +88,6 @@ gossipd-all: lightningd/lightning_gossipd $(LIGHTNINGD_GOSSIP_CLIENT_OBJS) lightningd/lightning_gossipd: $(LIGHTNINGD_GOSSIP_OBJS) $(GOSSIPD_COMMON_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) $(LIGHTNINGD_HSM_CLIENT_OBJS) -gossipd/gen_gossip_wire.h: $(WIRE_GEN) gossipd/gossip_wire.csv - $(WIRE_GEN) --page header $@ gossip_wire_type < gossipd/gossip_wire.csv > $@ - -gossipd/gen_gossip_wire.c: $(WIRE_GEN) gossipd/gossip_wire.csv - $(WIRE_GEN) --page impl ${@:.c=.h} gossip_wire_type < gossipd/gossip_wire.csv > $@ - -gossipd/gen_gossip_peerd_wire.h: $(WIRE_GEN) gossipd/gossip_peerd_wire.csv - $(WIRE_GEN) --page header $@ gossip_peerd_wire_type < gossipd/gossip_peerd_wire.csv > $@ - -gossipd/gen_gossip_peerd_wire.c: $(WIRE_GEN) gossipd/gossip_peerd_wire.csv - $(WIRE_GEN) --page impl ${@:.c=.h} gossip_peerd_wire_type < gossipd/gossip_peerd_wire.csv > $@ - -gossipd/gen_gossip_store.h: $(WIRE_GEN) gossipd/gossip_store.csv - $(WIRE_GEN) --page header $@ gossip_store_type < gossipd/gossip_store.csv > $@ - -gossipd/gen_gossip_store.c: $(WIRE_GEN) gossipd/gossip_store.csv - $(WIRE_GEN) --page impl ${@:.c=.h} gossip_store_type < gossipd/gossip_store.csv > $@ - - check-source: $(LIGHTNINGD_GOSSIP_ALLSRC_NOGEN:%=check-src-include-order/%) $(LIGHTNINGD_GOSSIP_ALLHEADERS_NOGEN:%=check-hdr-include-order/%) check-source-bolt: $(LIGHTNINGD_GOSSIP_SRC:%=bolt-check/%) $(LIGHTNINGD_GOSSIP_HEADERS:%=bolt-check/%) check-whitespace: $(LIGHTNINGD_GOSSIP_ALLSRC_NOGEN:%=check-whitespace/%) $(LIGHTNINGD_GOSSIP_ALLHEADERS_NOGEN:%=check-whitespace/%) @@ -114,6 +95,6 @@ check-whitespace: $(LIGHTNINGD_GOSSIP_ALLSRC_NOGEN:%=check-whitespace/%) $(LIGHT clean: gossipd-clean gossipd-clean: - $(RM) $(LIGHTNINGD_GOSSIP_OBJS) gossipd/gen_* + $(RM) $(LIGHTNINGD_GOSSIP_OBJS) -include gossipd/test/Makefile diff --git a/gossipd/gossip_generation.c b/gossipd/gossip_generation.c index 4407eea3a..c82a415db 100644 --- a/gossipd/gossip_generation.c +++ b/gossipd/gossip_generation.c @@ -9,10 +9,10 @@ #include #include #include -#include #include #include #include +#include #include #include #include diff --git a/gossipd/gossip_store.c b/gossipd/gossip_store.c index 67531a958..7e660a27b 100644 --- a/gossipd/gossip_store.c +++ b/gossipd/gossip_store.c @@ -11,9 +11,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/gossipd/gossip_store.csv b/gossipd/gossip_store_wire.csv similarity index 100% rename from gossipd/gossip_store.csv rename to gossipd/gossip_store_wire.csv diff --git a/gossipd/gossip_wire.csv b/gossipd/gossip_wire.csv deleted file mode 100644 index 9231fd764..000000000 --- a/gossipd/gossip_wire.csv +++ /dev/null @@ -1,140 +0,0 @@ -#include -#include -#include -#include - -# Initialize the gossip daemon. -msgtype,gossipctl_init,3000 -msgdata,gossipctl_init,chainparams,chainparams, -msgdata,gossipctl_init,our_features,feature_set, -msgdata,gossipctl_init,id,node_id, -msgdata,gossipctl_init,rgb,u8,3 -msgdata,gossipctl_init,alias,u8,32 -msgdata,gossipctl_init,num_announcable,u16, -msgdata,gossipctl_init,announcable,wireaddr,num_announcable -msgdata,gossipctl_init,dev_gossip_time,?u32, -msgdata,gossipctl_init,dev_fast_gossip,bool, -msgdata,gossipctl_init,dev_fast_gossip_prune,bool, - -# In developer mode, we can mess with time. -msgtype,gossip_dev_set_time,3001 -msgdata,gossip_dev_set_time,dev_gossip_time,u32, - -# Pass JSON-RPC getnodes call through -msgtype,gossip_getnodes_request,3005 -msgdata,gossip_getnodes_request,id,?node_id, - -#include -msgtype,gossip_getnodes_reply,3105 -msgdata,gossip_getnodes_reply,num_nodes,u32, -msgdata,gossip_getnodes_reply,nodes,gossip_getnodes_entry,num_nodes - -# Pass JSON-RPC getroute call through -msgtype,gossip_getroute_request,3006 -# Source defaults to "us", and means we don't consider first-hop channel fees -msgdata,gossip_getroute_request,source,?node_id, -msgdata,gossip_getroute_request,destination,node_id, -msgdata,gossip_getroute_request,msatoshi,amount_msat, -msgdata,gossip_getroute_request,riskfactor_millionths,u64, -msgdata,gossip_getroute_request,final_cltv,u32, -msgdata,gossip_getroute_request,fuzz_millionths,u64, -msgdata,gossip_getroute_request,num_excluded,u16, -msgdata,gossip_getroute_request,excluded,exclude_entry,num_excluded -msgdata,gossip_getroute_request,max_hops,u32, - -msgtype,gossip_getroute_reply,3106 -msgdata,gossip_getroute_reply,num_hops,u16, -msgdata,gossip_getroute_reply,hops,route_hop,num_hops - -msgtype,gossip_getchannels_request,3007 -msgdata,gossip_getchannels_request,short_channel_id,?short_channel_id, -msgdata,gossip_getchannels_request,source,?node_id, -msgdata,gossip_getchannels_request,prev,?short_channel_id, - -msgtype,gossip_getchannels_reply,3107 -msgdata,gossip_getchannels_reply,complete,bool, -msgdata,gossip_getchannels_reply,num_channels,u32, -msgdata,gossip_getchannels_reply,nodes,gossip_getchannels_entry,num_channels - -# Ping/pong test. Waits for a reply if it expects one. -msgtype,gossip_ping,3008 -msgdata,gossip_ping,id,node_id, -msgdata,gossip_ping,num_pong_bytes,u16, -msgdata,gossip_ping,len,u16, - -msgtype,gossip_ping_reply,3108 -msgdata,gossip_ping_reply,id,node_id, -# False if id in gossip_ping was unknown. -msgdata,gossip_ping_reply,sent,bool, -# 0 == no pong expected -msgdata,gossip_ping_reply,totlen,u16, - -# Set artificial maximum reply_channel_range size. Master->gossipd -msgtype,gossip_dev_set_max_scids_encode_size,3030 -msgdata,gossip_dev_set_max_scids_encode_size,max,u32, - -# Given a short_channel_id, return the latest (stripped) update for error msg. -msgtype,gossip_get_stripped_cupdate,3010 -msgdata,gossip_get_stripped_cupdate,channel_id,short_channel_id, - -msgtype,gossip_get_stripped_cupdate_reply,3110 -msgdata,gossip_get_stripped_cupdate_reply,stripped_update_len,u16, -msgdata,gossip_get_stripped_cupdate_reply,stripped_update,u8,stripped_update_len - -# gossipd->master: we're closing this channel. -msgtype,gossip_local_channel_close,3027 -msgdata,gossip_local_channel_close,short_channel_id,short_channel_id, - -# Gossipd->master get this tx output please. -msgtype,gossip_get_txout,3018 -msgdata,gossip_get_txout,short_channel_id,short_channel_id, - -# master->gossipd here is the output, or empty if none. -msgtype,gossip_get_txout_reply,3118 -msgdata,gossip_get_txout_reply,short_channel_id,short_channel_id, -msgdata,gossip_get_txout_reply,satoshis,amount_sat, -msgdata,gossip_get_txout_reply,len,u16, -msgdata,gossip_get_txout_reply,outscript,u8,len - -# master->gossipd an htlc failed with this onion error. -msgtype,gossip_payment_failure,3021 -msgdata,gossip_payment_failure,len,u16, -msgdata,gossip_payment_failure,error,u8,len - -# master -> gossipd: a potential funding outpoint was spent, please forget the eventual channel -msgtype,gossip_outpoint_spent,3024 -msgdata,gossip_outpoint_spent,short_channel_id,short_channel_id, - -# master -> gossipd: stop gossip timers. -msgtype,gossip_dev_suppress,3032 - -# master -> gossipd: do you have a memleak? -msgtype,gossip_dev_memleak,3033 - -msgtype,gossip_dev_memleak_reply,3133 -msgdata,gossip_dev_memleak_reply,leak,bool, - -# master -> gossipd: please rewrite the gossip_store -msgtype,gossip_dev_compact_store,3034 - -# gossipd -> master: ok -msgtype,gossip_dev_compact_store_reply,3134 -msgdata,gossip_dev_compact_store_reply,success,bool, - -#include - -# master -> gossipd: get route_info for our incoming channels -msgtype,gossip_get_incoming_channels,3025 - -# gossipd -> master: here they are. -msgtype,gossip_get_incoming_channels_reply,3125 -msgdata,gossip_get_incoming_channels_reply,num_public,u16, -msgdata,gossip_get_incoming_channels_reply,public_route_info,route_info,num_public -msgdata,gossip_get_incoming_channels_reply,public_deadends,bool,num_public -msgdata,gossip_get_incoming_channels_reply,num_private,u16, -msgdata,gossip_get_incoming_channels_reply,private_route_info,route_info,num_private -msgdata,gossip_get_incoming_channels_reply,private_deadends,bool,num_private - -# master -> gossipd: blockheight increased. -msgtype,gossip_new_blockheight,3026 -msgdata,gossip_new_blockheight,blockheight,u32, diff --git a/gossipd/gossipd.c b/gossipd/gossipd.c index 398dd7614..e10b3b865 100644 --- a/gossipd/gossipd.c +++ b/gossipd/gossipd.c @@ -45,10 +45,10 @@ #include #include #include -#include -#include #include #include +#include +#include #include #include #include @@ -249,7 +249,7 @@ static const u8 *handle_channel_announcement_msg(struct peer *peer, tal_arr_expand(&peer->daemon->deferred_txouts, *scid); } else { daemon_conn_send(peer->daemon->master, - take(towire_gossip_get_txout(NULL, + take(towire_gossipd_get_txout(NULL, scid))); } } @@ -331,7 +331,7 @@ static const u8 *handle_pong(struct peer *peer, const u8 *pong) return towire_errorfmt(peer, NULL, "%s", err); daemon_conn_send(peer->daemon->master, - take(towire_gossip_ping_reply(NULL, &peer->id, true, + take(towire_gossipd_ping_reply(NULL, &peer->id, true, tal_count(pong)))); return NULL; } @@ -497,8 +497,8 @@ static struct io_plan *peer_msg_in(struct io_conn *conn, return io_close(conn); } - /* Must be a gossip_peerd_wire_type asking us to do something. */ - switch ((enum gossip_peerd_wire_type)fromwire_peektype(msg)) { + /* Must be a gossipd_peerd_wire_type asking us to do something. */ + switch ((enum gossipd_peerd_wire)fromwire_peektype(msg)) { case WIRE_GOSSIPD_GET_UPDATE: ok = handle_get_local_channel_update(peer, msg); goto handled_cmd; @@ -522,7 +522,7 @@ static struct io_plan *peer_msg_in(struct io_conn *conn, /* Anything else should not have been sent to us: close on it */ status_peer_broken(&peer->id, "unexpected cmd of type %i %s", fromwire_peektype(msg), - gossip_peerd_wire_type_name(fromwire_peektype(msg))); + gossipd_peerd_wire_name(fromwire_peektype(msg))); return io_close(conn); /* Commands should always be OK. */ @@ -832,7 +832,7 @@ static struct io_plan *gossip_init(struct io_conn *conn, bool dev_fast_gossip, dev_fast_gossip_prune; u32 timestamp; - if (!fromwire_gossipctl_init(daemon, msg, + if (!fromwire_gossipd_init(daemon, msg, &chainparams, &daemon->our_features, &daemon->id, @@ -842,7 +842,7 @@ static struct io_plan *gossip_init(struct io_conn *conn, &dev_gossip_time, &dev_fast_gossip, &dev_fast_gossip_prune)) { - master_badmsg(WIRE_GOSSIPCTL_INIT, msg); + master_badmsg(WIRE_GOSSIPD_INIT, msg); } daemon->rstate = new_routing_state(daemon, @@ -907,10 +907,10 @@ static struct io_plan *getroute_req(struct io_conn *conn, struct daemon *daemon, * for a route from ourselves (the usual case): in that case, * we don't have to consider fees on our own outgoing channels. */ - if (!fromwire_gossip_getroute_request( + if (!fromwire_gossipd_getroute_request( msg, msg, &source, &destination, &msat, &riskfactor_millionths, &final_cltv, &fuzz_millionths, &excluded, &max_hops)) - master_badmsg(WIRE_GOSSIP_GETROUTE_REQUEST, msg); + master_badmsg(WIRE_GOSSIPD_GETROUTE_REQUEST, msg); status_debug("Trying to find a route from %s to %s for %s", source @@ -924,7 +924,7 @@ static struct io_plan *getroute_req(struct io_conn *conn, struct daemon *daemon, fuzz_millionths / 1000000.0, pseudorand_u64(), excluded, max_hops); - out = towire_gossip_getroute_reply(NULL, + out = towire_gossipd_getroute_reply(NULL, cast_const2(const struct route_hop **, hops)); daemon_conn_send(daemon->master, take(out)); @@ -1045,9 +1045,9 @@ static struct io_plan *getchannels_req(struct io_conn *conn, bool complete = true; /* Note: scid is marked optional in gossip_wire.csv */ - if (!fromwire_gossip_getchannels_request(msg, msg, &scid, &source, + if (!fromwire_gossipd_getchannels_request(msg, msg, &scid, &source, &prev)) - master_badmsg(WIRE_GOSSIP_GETCHANNELS_REQUEST, msg); + master_badmsg(WIRE_GOSSIPD_GETCHANNELS_REQUEST, msg); entries = tal_arr(tmpctx, const struct gossip_getchannels_entry *, 0); /* They can ask about a particular channel by short_channel_id */ @@ -1083,7 +1083,7 @@ static struct io_plan *getchannels_req(struct io_conn *conn, } } - out = towire_gossip_getchannels_reply(NULL, complete, entries); + out = towire_gossipd_getchannels_reply(NULL, complete, entries); daemon_conn_send(daemon->master, take(out)); return daemon_conn_read_next(conn, daemon->master); } @@ -1119,8 +1119,8 @@ static struct io_plan *getnodes(struct io_conn *conn, struct daemon *daemon, struct gossip_getnodes_entry *node_arr; struct node_id *id; - if (!fromwire_gossip_getnodes_request(tmpctx, msg, &id)) - master_badmsg(WIRE_GOSSIP_GETNODES_REQUEST, msg); + if (!fromwire_gossipd_getnodes_request(tmpctx, msg, &id)) + master_badmsg(WIRE_GOSSIPD_GETNODES_REQUEST, msg); /* Format of reply is the same whether they ask for a specific node * (0 or one responses) or all nodes (0 or more) */ @@ -1153,7 +1153,7 @@ static struct io_plan *getnodes(struct io_conn *conn, struct daemon *daemon, tal_count(node_arr)); for (size_t i = 0; i < tal_count(node_arr); i++) nodes[i] = &node_arr[i]; - out = towire_gossip_getnodes_reply(NULL, nodes); + out = towire_gossipd_getnodes_reply(NULL, nodes); daemon_conn_send(daemon->master, take(out)); return daemon_conn_read_next(conn, daemon->master); } @@ -1168,8 +1168,8 @@ static struct io_plan *ping_req(struct io_conn *conn, struct daemon *daemon, struct peer *peer; u8 *ping; - if (!fromwire_gossip_ping(msg, &id, &num_pong_bytes, &len)) - master_badmsg(WIRE_GOSSIP_PING, msg); + if (!fromwire_gossipd_ping(msg, &id, &num_pong_bytes, &len)) + master_badmsg(WIRE_GOSSIPD_PING, msg); /* Even if lightningd were to check for valid ids, there's a race * where it might vanish before we read this command; cleaner to @@ -1177,7 +1177,7 @@ static struct io_plan *ping_req(struct io_conn *conn, struct daemon *daemon, peer = find_peer(daemon, &id); if (!peer) { daemon_conn_send(daemon->master, - take(towire_gossip_ping_reply(NULL, &id, + take(towire_gossipd_ping_reply(NULL, &id, false, 0))); goto out; } @@ -1203,7 +1203,7 @@ static struct io_plan *ping_req(struct io_conn *conn, struct daemon *daemon, */ if (num_pong_bytes >= 65532) daemon_conn_send(daemon->master, - take(towire_gossip_ping_reply(NULL, &id, + take(towire_gossipd_ping_reply(NULL, &id, true, 0))); else /* We'll respond to lightningd once the pong comes in */ @@ -1244,8 +1244,8 @@ static struct io_plan *get_incoming_channels(struct io_conn *conn, bool *priv_deadends = tal_arr(tmpctx, bool, 0); bool *pub_deadends = tal_arr(tmpctx, bool, 0); - if (!fromwire_gossip_get_incoming_channels(msg)) - master_badmsg(WIRE_GOSSIP_GET_INCOMING_CHANNELS, msg); + if (!fromwire_gossipd_get_incoming_channels(msg)) + master_badmsg(WIRE_GOSSIPD_GET_INCOMING_CHANNELS, msg); node = get_node(daemon->rstate, &daemon->rstate->local_id); if (node) { @@ -1280,7 +1280,7 @@ static struct io_plan *get_incoming_channels(struct io_conn *conn, } } - msg = towire_gossip_get_incoming_channels_reply(NULL, + msg = towire_gossipd_get_incoming_channels_reply(NULL, public, pub_deadends, private, priv_deadends); daemon_conn_send(daemon->master, take(msg)); @@ -1292,8 +1292,8 @@ static struct io_plan *new_blockheight(struct io_conn *conn, struct daemon *daemon, const u8 *msg) { - if (!fromwire_gossip_new_blockheight(msg, &daemon->current_blockheight)) - master_badmsg(WIRE_GOSSIP_NEW_BLOCKHEIGHT, msg); + if (!fromwire_gossipd_new_blockheight(msg, &daemon->current_blockheight)) + master_badmsg(WIRE_GOSSIPD_NEW_BLOCKHEIGHT, msg); /* Check if we can now send any deferred queries. */ for (size_t i = 0; i < tal_count(daemon->deferred_txouts); i++) { @@ -1306,7 +1306,7 @@ static struct io_plan *new_blockheight(struct io_conn *conn, /* short_channel_id is deep enough, now ask about it. */ daemon_conn_send(daemon->master, - take(towire_gossip_get_txout(NULL, scid))); + take(towire_gossipd_get_txout(NULL, scid))); tal_arr_remove(&daemon->deferred_txouts, i); i--; @@ -1321,8 +1321,8 @@ static struct io_plan *dev_gossip_suppress(struct io_conn *conn, struct daemon *daemon, const u8 *msg) { - if (!fromwire_gossip_dev_suppress(msg)) - master_badmsg(WIRE_GOSSIP_DEV_SUPPRESS, msg); + if (!fromwire_gossipd_dev_suppress(msg)) + master_badmsg(WIRE_GOSSIPD_DEV_SUPPRESS, msg); status_unusual("Suppressing all gossip"); dev_suppress_gossip = true; @@ -1343,7 +1343,7 @@ static struct io_plan *dev_gossip_memleak(struct io_conn *conn, found_leak = dump_memleak(memtable); daemon_conn_send(daemon->master, - take(towire_gossip_dev_memleak_reply(NULL, + take(towire_gossipd_dev_memleak_reply(NULL, found_leak))); return daemon_conn_read_next(conn, daemon->master); } @@ -1355,7 +1355,7 @@ static struct io_plan *dev_compact_store(struct io_conn *conn, bool done = gossip_store_compact(daemon->rstate->gs); daemon_conn_send(daemon->master, - take(towire_gossip_dev_compact_store_reply(NULL, + take(towire_gossipd_dev_compact_store_reply(NULL, done))); return daemon_conn_read_next(conn, daemon->master); } @@ -1366,8 +1366,8 @@ static struct io_plan *dev_gossip_set_time(struct io_conn *conn, { u32 time; - if (!fromwire_gossip_dev_set_time(msg, &time)) - master_badmsg(WIRE_GOSSIP_DEV_SET_TIME, msg); + if (!fromwire_gossipd_dev_set_time(msg, &time)) + master_badmsg(WIRE_GOSSIPD_DEV_SET_TIME, msg); if (!daemon->rstate->gossip_time) daemon->rstate->gossip_time = tal(daemon->rstate, struct timeabs); daemon->rstate->gossip_time->ts.tv_sec = time; @@ -1386,8 +1386,8 @@ static struct io_plan *get_stripped_cupdate(struct io_conn *conn, struct local_chan *local_chan; const u8 *stripped_update; - if (!fromwire_gossip_get_stripped_cupdate(msg, &scid)) - master_badmsg(WIRE_GOSSIP_GET_STRIPPED_CUPDATE, msg); + if (!fromwire_gossipd_get_stripped_cupdate(msg, &scid)) + master_badmsg(WIRE_GOSSIPD_GET_STRIPPED_CUPDATE, msg); local_chan = local_chan_map_get(&daemon->rstate->local_chan_map, &scid); if (!local_chan) { @@ -1412,7 +1412,7 @@ static struct io_plan *get_stripped_cupdate(struct io_conn *conn, stripped_update = NULL; } daemon_conn_send(daemon->master, - take(towire_gossip_get_stripped_cupdate_reply(NULL, + take(towire_gossipd_get_stripped_cupdate_reply(NULL, stripped_update))); return daemon_conn_read_next(conn, daemon->master); } @@ -1427,8 +1427,8 @@ static struct io_plan *handle_txout_reply(struct io_conn *conn, struct amount_sat sat; bool good; - if (!fromwire_gossip_get_txout_reply(msg, msg, &scid, &sat, &outscript)) - master_badmsg(WIRE_GOSSIP_GET_TXOUT_REPLY, msg); + if (!fromwire_gossipd_get_txout_reply(msg, msg, &scid, &sat, &outscript)) + master_badmsg(WIRE_GOSSIPD_GET_TXOUT_REPLY, msg); /* Outscript is NULL if it's not an unspent output */ good = handle_pending_cannouncement(daemon, daemon->rstate, @@ -1509,8 +1509,8 @@ static struct io_plan *handle_payment_failure(struct io_conn *conn, u8 *error; u8 *channel_update; - if (!fromwire_gossip_payment_failure(msg, msg, &error)) - master_badmsg(WIRE_GOSSIP_PAYMENT_FAILURE, msg); + if (!fromwire_gossipd_payment_failure(msg, msg, &error)) + master_badmsg(WIRE_GOSSIPD_PAYMENT_FAILURE, msg); channel_update = channel_update_from_onion_error(tmpctx, error); if (channel_update) { @@ -1539,8 +1539,8 @@ static struct io_plan *handle_outpoint_spent(struct io_conn *conn, struct short_channel_id scid; struct chan *chan; struct routing_state *rstate = daemon->rstate; - if (!fromwire_gossip_outpoint_spent(msg, &scid)) - master_badmsg(WIRE_GOSSIP_OUTPOINT_SPENT, msg); + if (!fromwire_gossipd_outpoint_spent(msg, &scid)) + master_badmsg(WIRE_GOSSIPD_OUTPOINT_SPENT, msg); chan = get_channel(rstate, &scid); if (chan) { @@ -1576,8 +1576,8 @@ static struct io_plan *handle_local_channel_close(struct io_conn *conn, struct short_channel_id scid; struct chan *chan; struct routing_state *rstate = daemon->rstate; - if (!fromwire_gossip_local_channel_close(msg, &scid)) - master_badmsg(WIRE_GOSSIP_LOCAL_CHANNEL_CLOSE, msg); + if (!fromwire_gossipd_local_channel_close(msg, &scid)) + master_badmsg(WIRE_GOSSIPD_LOCAL_CHANNEL_CLOSE, msg); chan = get_channel(rstate, &scid); if (chan) @@ -1590,75 +1590,75 @@ static struct io_plan *recv_req(struct io_conn *conn, const u8 *msg, struct daemon *daemon) { - enum gossip_wire_type t = fromwire_peektype(msg); + enum gossipd_wire t = fromwire_peektype(msg); switch (t) { - case WIRE_GOSSIPCTL_INIT: + case WIRE_GOSSIPD_INIT: return gossip_init(conn, daemon, msg); - case WIRE_GOSSIP_GETNODES_REQUEST: + case WIRE_GOSSIPD_GETNODES_REQUEST: return getnodes(conn, daemon, msg); - case WIRE_GOSSIP_GETROUTE_REQUEST: + case WIRE_GOSSIPD_GETROUTE_REQUEST: return getroute_req(conn, daemon, msg); - case WIRE_GOSSIP_GETCHANNELS_REQUEST: + case WIRE_GOSSIPD_GETCHANNELS_REQUEST: return getchannels_req(conn, daemon, msg); - case WIRE_GOSSIP_GET_STRIPPED_CUPDATE: + case WIRE_GOSSIPD_GET_STRIPPED_CUPDATE: return get_stripped_cupdate(conn, daemon, msg); - case WIRE_GOSSIP_GET_TXOUT_REPLY: + case WIRE_GOSSIPD_GET_TXOUT_REPLY: return handle_txout_reply(conn, daemon, msg); - case WIRE_GOSSIP_PAYMENT_FAILURE: + case WIRE_GOSSIPD_PAYMENT_FAILURE: return handle_payment_failure(conn, daemon, msg); - case WIRE_GOSSIP_OUTPOINT_SPENT: + case WIRE_GOSSIPD_OUTPOINT_SPENT: return handle_outpoint_spent(conn, daemon, msg); - case WIRE_GOSSIP_LOCAL_CHANNEL_CLOSE: + case WIRE_GOSSIPD_LOCAL_CHANNEL_CLOSE: return handle_local_channel_close(conn, daemon, msg); - case WIRE_GOSSIP_PING: + case WIRE_GOSSIPD_PING: return ping_req(conn, daemon, msg); - case WIRE_GOSSIP_GET_INCOMING_CHANNELS: + case WIRE_GOSSIPD_GET_INCOMING_CHANNELS: return get_incoming_channels(conn, daemon, msg); - case WIRE_GOSSIP_NEW_BLOCKHEIGHT: + case WIRE_GOSSIPD_NEW_BLOCKHEIGHT: return new_blockheight(conn, daemon, msg); #if DEVELOPER - case WIRE_GOSSIP_DEV_SET_MAX_SCIDS_ENCODE_SIZE: + case WIRE_GOSSIPD_DEV_SET_MAX_SCIDS_ENCODE_SIZE: return dev_set_max_scids_encode_size(conn, daemon, msg); - case WIRE_GOSSIP_DEV_SUPPRESS: + case WIRE_GOSSIPD_DEV_SUPPRESS: return dev_gossip_suppress(conn, daemon, msg); - case WIRE_GOSSIP_DEV_MEMLEAK: + case WIRE_GOSSIPD_DEV_MEMLEAK: return dev_gossip_memleak(conn, daemon, msg); - case WIRE_GOSSIP_DEV_COMPACT_STORE: + case WIRE_GOSSIPD_DEV_COMPACT_STORE: return dev_compact_store(conn, daemon, msg); - case WIRE_GOSSIP_DEV_SET_TIME: + case WIRE_GOSSIPD_DEV_SET_TIME: return dev_gossip_set_time(conn, daemon, msg); #else - case WIRE_GOSSIP_DEV_SET_MAX_SCIDS_ENCODE_SIZE: - case WIRE_GOSSIP_DEV_SUPPRESS: - case WIRE_GOSSIP_DEV_MEMLEAK: - case WIRE_GOSSIP_DEV_COMPACT_STORE: - case WIRE_GOSSIP_DEV_SET_TIME: + case WIRE_GOSSIPD_DEV_SET_MAX_SCIDS_ENCODE_SIZE: + case WIRE_GOSSIPD_DEV_SUPPRESS: + case WIRE_GOSSIPD_DEV_MEMLEAK: + case WIRE_GOSSIPD_DEV_COMPACT_STORE: + case WIRE_GOSSIPD_DEV_SET_TIME: break; #endif /* !DEVELOPER */ /* We send these, we don't receive them */ - case WIRE_GOSSIP_GETNODES_REPLY: - case WIRE_GOSSIP_GETROUTE_REPLY: - case WIRE_GOSSIP_GETCHANNELS_REPLY: - case WIRE_GOSSIP_PING_REPLY: - case WIRE_GOSSIP_GET_STRIPPED_CUPDATE_REPLY: - case WIRE_GOSSIP_GET_INCOMING_CHANNELS_REPLY: - case WIRE_GOSSIP_GET_TXOUT: - case WIRE_GOSSIP_DEV_MEMLEAK_REPLY: - case WIRE_GOSSIP_DEV_COMPACT_STORE_REPLY: + case WIRE_GOSSIPD_GETNODES_REPLY: + case WIRE_GOSSIPD_GETROUTE_REPLY: + case WIRE_GOSSIPD_GETCHANNELS_REPLY: + case WIRE_GOSSIPD_PING_REPLY: + case WIRE_GOSSIPD_GET_STRIPPED_CUPDATE_REPLY: + case WIRE_GOSSIPD_GET_INCOMING_CHANNELS_REPLY: + case WIRE_GOSSIPD_GET_TXOUT: + case WIRE_GOSSIPD_DEV_MEMLEAK_REPLY: + case WIRE_GOSSIPD_DEV_COMPACT_STORE_REPLY: break; } diff --git a/gossipd/gossip_peerd_wire.csv b/gossipd/gossipd_peerd_wire.csv similarity index 100% rename from gossipd/gossip_peerd_wire.csv rename to gossipd/gossipd_peerd_wire.csv diff --git a/gossipd/gossipd_wire.csv b/gossipd/gossipd_wire.csv new file mode 100644 index 000000000..7b71bf527 --- /dev/null +++ b/gossipd/gossipd_wire.csv @@ -0,0 +1,140 @@ +#include +#include +#include +#include + +# Initialize the gossip daemon. +msgtype,gossipd_init,3000 +msgdata,gossipd_init,chainparams,chainparams, +msgdata,gossipd_init,our_features,feature_set, +msgdata,gossipd_init,id,node_id, +msgdata,gossipd_init,rgb,u8,3 +msgdata,gossipd_init,alias,u8,32 +msgdata,gossipd_init,num_announcable,u16, +msgdata,gossipd_init,announcable,wireaddr,num_announcable +msgdata,gossipd_init,dev_gossip_time,?u32, +msgdata,gossipd_init,dev_fast_gossip,bool, +msgdata,gossipd_init,dev_fast_gossip_prune,bool, + +# In developer mode, we can mess with time. +msgtype,gossipd_dev_set_time,3001 +msgdata,gossipd_dev_set_time,dev_gossip_time,u32, + +# Pass JSON-RPC getnodes call through +msgtype,gossipd_getnodes_request,3005 +msgdata,gossipd_getnodes_request,id,?node_id, + +#include +msgtype,gossipd_getnodes_reply,3105 +msgdata,gossipd_getnodes_reply,num_nodes,u32, +msgdata,gossipd_getnodes_reply,nodes,gossip_getnodes_entry,num_nodes + +# Pass JSON-RPC getroute call through +msgtype,gossipd_getroute_request,3006 +# Source defaults to "us", and means we don't consider first-hop channel fees +msgdata,gossipd_getroute_request,source,?node_id, +msgdata,gossipd_getroute_request,destination,node_id, +msgdata,gossipd_getroute_request,msatoshi,amount_msat, +msgdata,gossipd_getroute_request,riskfactor_millionths,u64, +msgdata,gossipd_getroute_request,final_cltv,u32, +msgdata,gossipd_getroute_request,fuzz_millionths,u64, +msgdata,gossipd_getroute_request,num_excluded,u16, +msgdata,gossipd_getroute_request,excluded,exclude_entry,num_excluded +msgdata,gossipd_getroute_request,max_hops,u32, + +msgtype,gossipd_getroute_reply,3106 +msgdata,gossipd_getroute_reply,num_hops,u16, +msgdata,gossipd_getroute_reply,hops,route_hop,num_hops + +msgtype,gossipd_getchannels_request,3007 +msgdata,gossipd_getchannels_request,short_channel_id,?short_channel_id, +msgdata,gossipd_getchannels_request,source,?node_id, +msgdata,gossipd_getchannels_request,prev,?short_channel_id, + +msgtype,gossipd_getchannels_reply,3107 +msgdata,gossipd_getchannels_reply,complete,bool, +msgdata,gossipd_getchannels_reply,num_channels,u32, +msgdata,gossipd_getchannels_reply,nodes,gossip_getchannels_entry,num_channels + +# Ping/pong test. Waits for a reply if it expects one. +msgtype,gossipd_ping,3008 +msgdata,gossipd_ping,id,node_id, +msgdata,gossipd_ping,num_pong_bytes,u16, +msgdata,gossipd_ping,len,u16, + +msgtype,gossipd_ping_reply,3108 +msgdata,gossipd_ping_reply,id,node_id, +# False if id in gossip_ping was unknown. +msgdata,gossipd_ping_reply,sent,bool, +# 0 == no pong expected +msgdata,gossipd_ping_reply,totlen,u16, + +# Set artificial maximum reply_channel_range size. Master->gossipd +msgtype,gossipd_dev_set_max_scids_encode_size,3030 +msgdata,gossipd_dev_set_max_scids_encode_size,max,u32, + +# Given a short_channel_id, return the latest (stripped) update for error msg. +msgtype,gossipd_get_stripped_cupdate,3010 +msgdata,gossipd_get_stripped_cupdate,channel_id,short_channel_id, + +msgtype,gossipd_get_stripped_cupdate_reply,3110 +msgdata,gossipd_get_stripped_cupdate_reply,stripped_update_len,u16, +msgdata,gossipd_get_stripped_cupdate_reply,stripped_update,u8,stripped_update_len + +# gossipd->master: we're closing this channel. +msgtype,gossipd_local_channel_close,3027 +msgdata,gossipd_local_channel_close,short_channel_id,short_channel_id, + +# Gossipd->master get this tx output please. +msgtype,gossipd_get_txout,3018 +msgdata,gossipd_get_txout,short_channel_id,short_channel_id, + +# master->gossipd here is the output, or empty if none. +msgtype,gossipd_get_txout_reply,3118 +msgdata,gossipd_get_txout_reply,short_channel_id,short_channel_id, +msgdata,gossipd_get_txout_reply,satoshis,amount_sat, +msgdata,gossipd_get_txout_reply,len,u16, +msgdata,gossipd_get_txout_reply,outscript,u8,len + +# master->gossipd an htlc failed with this onion error. +msgtype,gossipd_payment_failure,3021 +msgdata,gossipd_payment_failure,len,u16, +msgdata,gossipd_payment_failure,error,u8,len + +# master -> gossipd: a potential funding outpoint was spent, please forget the eventual channel +msgtype,gossipd_outpoint_spent,3024 +msgdata,gossipd_outpoint_spent,short_channel_id,short_channel_id, + +# master -> gossipd: stop gossip timers. +msgtype,gossipd_dev_suppress,3032 + +# master -> gossipd: do you have a memleak? +msgtype,gossipd_dev_memleak,3033 + +msgtype,gossipd_dev_memleak_reply,3133 +msgdata,gossipd_dev_memleak_reply,leak,bool, + +# master -> gossipd: please rewrite the gossip_store +msgtype,gossipd_dev_compact_store,3034 + +# gossipd -> master: ok +msgtype,gossipd_dev_compact_store_reply,3134 +msgdata,gossipd_dev_compact_store_reply,success,bool, + +#include + +# master -> gossipd: get route_info for our incoming channels +msgtype,gossipd_get_incoming_channels,3025 + +# gossipd -> master: here they are. +msgtype,gossipd_get_incoming_channels_reply,3125 +msgdata,gossipd_get_incoming_channels_reply,num_public,u16, +msgdata,gossipd_get_incoming_channels_reply,public_route_info,route_info,num_public +msgdata,gossipd_get_incoming_channels_reply,public_deadends,bool,num_public +msgdata,gossipd_get_incoming_channels_reply,num_private,u16, +msgdata,gossipd_get_incoming_channels_reply,private_route_info,route_info,num_private +msgdata,gossipd_get_incoming_channels_reply,private_deadends,bool,num_private + +# master -> gossipd: blockheight increased. +msgtype,gossipd_new_blockheight,3026 +msgdata,gossipd_new_blockheight,blockheight,u32, diff --git a/gossipd/queries.c b/gossipd/queries.c index 2f6934051..d007199a7 100644 --- a/gossipd/queries.c +++ b/gossipd/queries.c @@ -9,9 +9,9 @@ #include #include #include -#include #include #include +#include #include #include #include @@ -1072,9 +1072,9 @@ struct io_plan *dev_set_max_scids_encode_size(struct io_conn *conn, struct daemon *daemon, const u8 *msg) { - if (!fromwire_gossip_dev_set_max_scids_encode_size(msg, + if (!fromwire_gossipd_dev_set_max_scids_encode_size(msg, &max_encoding_bytes)) - master_badmsg(WIRE_GOSSIP_DEV_SET_MAX_SCIDS_ENCODE_SIZE, msg); + master_badmsg(WIRE_GOSSIPD_DEV_SET_MAX_SCIDS_ENCODE_SIZE, msg); status_debug("Set max_scids_encode_bytes to %u", max_encoding_bytes); return daemon_conn_read_next(conn, daemon->master); diff --git a/gossipd/routing.c b/gossipd/routing.c index 26e8df211..53882955d 100644 --- a/gossipd/routing.c +++ b/gossipd/routing.c @@ -15,11 +15,11 @@ #include #include #include -#include -#include -#include #include +#include #include +#include +#include #include #include diff --git a/gossipd/test/run-crc32_of_update.c b/gossipd/test/run-crc32_of_update.c index f5ca3dc9f..a8fe46d71 100644 --- a/gossipd/test/run-crc32_of_update.c +++ b/gossipd/test/run-crc32_of_update.c @@ -31,9 +31,9 @@ struct peer *find_peer(struct daemon *daemon UNNEEDED, const struct node_id *id /* 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(); } -/* Generated stub for fromwire_gossip_dev_set_max_scids_encode_size */ -bool fromwire_gossip_dev_set_max_scids_encode_size(const void *p UNNEEDED, u32 *max UNNEEDED) -{ fprintf(stderr, "fromwire_gossip_dev_set_max_scids_encode_size called!\n"); abort(); } +/* Generated stub for fromwire_gossipd_dev_set_max_scids_encode_size */ +bool fromwire_gossipd_dev_set_max_scids_encode_size(const void *p UNNEEDED, u32 *max UNNEEDED) +{ fprintf(stderr, "fromwire_gossipd_dev_set_max_scids_encode_size called!\n"); abort(); } /* Generated stub for fromwire_gossipd_local_channel_update */ bool fromwire_gossipd_local_channel_update(const void *p UNNEEDED, struct short_channel_id *short_channel_id UNNEEDED, bool *disable UNNEEDED, u16 *cltv_expiry_delta UNNEEDED, struct amount_msat *htlc_minimum_msat UNNEEDED, u32 *fee_base_msat UNNEEDED, u32 *fee_proportional_millionths UNNEEDED, struct amount_msat *htlc_maximum_msat UNNEEDED) { fprintf(stderr, "fromwire_gossipd_local_channel_update called!\n"); abort(); } diff --git a/gossipd/test/run-extended-info.c b/gossipd/test/run-extended-info.c index 76d7b1ed7..d40b48c14 100644 --- a/gossipd/test/run-extended-info.c +++ b/gossipd/test/run-extended-info.c @@ -36,9 +36,9 @@ struct short_channel_id *decode_short_ids(const tal_t *ctx UNNEEDED, const u8 *e /* 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(); } -/* Generated stub for fromwire_gossip_dev_set_max_scids_encode_size */ -bool fromwire_gossip_dev_set_max_scids_encode_size(const void *p UNNEEDED, u32 *max UNNEEDED) -{ fprintf(stderr, "fromwire_gossip_dev_set_max_scids_encode_size called!\n"); abort(); } +/* Generated stub for fromwire_gossipd_dev_set_max_scids_encode_size */ +bool fromwire_gossipd_dev_set_max_scids_encode_size(const void *p UNNEEDED, u32 *max UNNEEDED) +{ fprintf(stderr, "fromwire_gossipd_dev_set_max_scids_encode_size called!\n"); abort(); } /* Generated stub for get_cupdate_parts */ void get_cupdate_parts(const u8 *channel_update UNNEEDED, const u8 *parts[2] UNNEEDED, diff --git a/lightningd/closing_control.c b/lightningd/closing_control.c index deb17d555..4e7c8e564 100644 --- a/lightningd/closing_control.c +++ b/lightningd/closing_control.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include #include @@ -311,6 +311,6 @@ void peer_start_closingd(struct channel *channel, * be used. */ if (channel->scid) subd_send_msg(channel->peer->ld->gossip, - take(towire_gossip_local_channel_close( + take(towire_gossipd_local_channel_close( tmpctx, channel->scid))); } diff --git a/lightningd/gossip_control.c b/lightningd/gossip_control.c index 5f476fe97..fcd56c40e 100644 --- a/lightningd/gossip_control.c +++ b/lightningd/gossip_control.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include @@ -54,7 +54,7 @@ static void got_txout(struct bitcoind *bitcoind, subd_send_msg( bitcoind->ld->gossip, - towire_gossip_get_txout_reply(scid, scid, sat, script)); + towire_gossipd_get_txout_reply(scid, scid, sat, script)); tal_free(scid); } @@ -99,7 +99,7 @@ static void get_txout(struct subd *gossip, const u8 *msg) u32 blockheight; struct chain_topology *topo = gossip->ld->topology; - if (!fromwire_gossip_get_txout(msg, scid)) + if (!fromwire_gossipd_get_txout(msg, scid)) fatal("Gossip gave bad GOSSIP_GET_TXOUT message %s", tal_hex(msg, msg)); @@ -110,7 +110,7 @@ static void get_txout(struct subd *gossip, const u8 *msg) if (op) { subd_send_msg(gossip, - towire_gossip_get_txout_reply( + towire_gossipd_get_txout_reply( scid, scid, op->sat, op->scriptpubkey)); tal_free(scid); } else if (wallet_have_block(gossip->ld->wallet, blockheight)) { @@ -118,7 +118,7 @@ static void get_txout(struct subd *gossip, const u8 *msg) * is in the DB. The fact that we don't means that this is * either a spent outpoint or an invalid one. Return a * failure. */ - subd_send_msg(gossip, take(towire_gossip_get_txout_reply( + subd_send_msg(gossip, take(towire_gossipd_get_txout_reply( NULL, scid, AMOUNT_SAT(0), NULL))); tal_free(scid); } else { @@ -128,42 +128,42 @@ static void get_txout(struct subd *gossip, const u8 *msg) static unsigned gossip_msg(struct subd *gossip, const u8 *msg, const int *fds) { - enum gossip_wire_type t = fromwire_peektype(msg); + enum gossipd_wire t = fromwire_peektype(msg); switch (t) { /* These are messages we send, not them. */ - case WIRE_GOSSIPCTL_INIT: - case WIRE_GOSSIP_GETNODES_REQUEST: - case WIRE_GOSSIP_GETROUTE_REQUEST: - case WIRE_GOSSIP_GETCHANNELS_REQUEST: - case WIRE_GOSSIP_PING: - case WIRE_GOSSIP_GET_STRIPPED_CUPDATE: - case WIRE_GOSSIP_GET_TXOUT_REPLY: - case WIRE_GOSSIP_OUTPOINT_SPENT: - case WIRE_GOSSIP_PAYMENT_FAILURE: - case WIRE_GOSSIP_GET_INCOMING_CHANNELS: - case WIRE_GOSSIP_DEV_SET_MAX_SCIDS_ENCODE_SIZE: - case WIRE_GOSSIP_DEV_SUPPRESS: - case WIRE_GOSSIP_LOCAL_CHANNEL_CLOSE: - case WIRE_GOSSIP_DEV_MEMLEAK: - case WIRE_GOSSIP_DEV_COMPACT_STORE: - case WIRE_GOSSIP_DEV_SET_TIME: - case WIRE_GOSSIP_NEW_BLOCKHEIGHT: + case WIRE_GOSSIPD_INIT: + case WIRE_GOSSIPD_GETNODES_REQUEST: + case WIRE_GOSSIPD_GETROUTE_REQUEST: + case WIRE_GOSSIPD_GETCHANNELS_REQUEST: + case WIRE_GOSSIPD_PING: + case WIRE_GOSSIPD_GET_STRIPPED_CUPDATE: + case WIRE_GOSSIPD_GET_TXOUT_REPLY: + case WIRE_GOSSIPD_OUTPOINT_SPENT: + case WIRE_GOSSIPD_PAYMENT_FAILURE: + case WIRE_GOSSIPD_GET_INCOMING_CHANNELS: + case WIRE_GOSSIPD_DEV_SET_MAX_SCIDS_ENCODE_SIZE: + case WIRE_GOSSIPD_DEV_SUPPRESS: + case WIRE_GOSSIPD_LOCAL_CHANNEL_CLOSE: + case WIRE_GOSSIPD_DEV_MEMLEAK: + case WIRE_GOSSIPD_DEV_COMPACT_STORE: + case WIRE_GOSSIPD_DEV_SET_TIME: + case WIRE_GOSSIPD_NEW_BLOCKHEIGHT: /* This is a reply, so never gets through to here. */ - case WIRE_GOSSIP_GETNODES_REPLY: - case WIRE_GOSSIP_GETROUTE_REPLY: - case WIRE_GOSSIP_GETCHANNELS_REPLY: - case WIRE_GOSSIP_GET_INCOMING_CHANNELS_REPLY: - case WIRE_GOSSIP_DEV_MEMLEAK_REPLY: - case WIRE_GOSSIP_DEV_COMPACT_STORE_REPLY: - case WIRE_GOSSIP_GET_STRIPPED_CUPDATE_REPLY: + case WIRE_GOSSIPD_GETNODES_REPLY: + case WIRE_GOSSIPD_GETROUTE_REPLY: + case WIRE_GOSSIPD_GETCHANNELS_REPLY: + case WIRE_GOSSIPD_GET_INCOMING_CHANNELS_REPLY: + case WIRE_GOSSIPD_DEV_MEMLEAK_REPLY: + case WIRE_GOSSIPD_DEV_COMPACT_STORE_REPLY: + case WIRE_GOSSIPD_GET_STRIPPED_CUPDATE_REPLY: break; - case WIRE_GOSSIP_PING_REPLY: + case WIRE_GOSSIPD_PING_REPLY: ping_reply(gossip, msg); break; - case WIRE_GOSSIP_GET_TXOUT: + case WIRE_GOSSIPD_GET_TXOUT: get_txout(gossip, msg); break; } @@ -177,7 +177,7 @@ void gossip_notify_new_block(struct lightningd *ld, u32 blockheight) return; subd_send_msg(ld->gossip, - take(towire_gossip_new_blockheight(NULL, blockheight))); + take(towire_gossipd_new_blockheight(NULL, blockheight))); } static void gossip_topology_synced(struct chain_topology *topo, void *unused) @@ -196,7 +196,7 @@ void gossip_init(struct lightningd *ld, int connectd_fd) hsmfd = hsm_get_global_fd(ld, HSM_CAP_SIGN_GOSSIP); ld->gossip = new_global_subd(ld, "lightning_gossipd", - gossip_wire_type_name, gossip_msg, + gossipd_wire_name, gossip_msg, take(&hsmfd), take(&connectd_fd), NULL); if (!ld->gossip) err(1, "Could not subdaemon gossip"); @@ -205,7 +205,7 @@ void gossip_init(struct lightningd *ld, int connectd_fd) topology_add_sync_waiter(ld->gossip, ld->topology, gossip_topology_synced, NULL); - msg = towire_gossipctl_init( + msg = towire_gossipd_init( tmpctx, chainparams, ld->our_features, @@ -222,7 +222,7 @@ void gossip_init(struct lightningd *ld, int connectd_fd) void gossipd_notify_spend(struct lightningd *ld, const struct short_channel_id *scid) { - u8 *msg = towire_gossip_outpoint_spent(tmpctx, scid); + u8 *msg = towire_gossipd_outpoint_spent(tmpctx, scid); subd_send_msg(ld->gossip, msg); } @@ -234,7 +234,7 @@ static void json_getnodes_reply(struct subd *gossip UNUSED, const u8 *reply, struct json_stream *response; size_t i, j; - if (!fromwire_gossip_getnodes_reply(reply, reply, &nodes)) { + if (!fromwire_gossipd_getnodes_reply(reply, reply, &nodes)) { was_pending(command_fail(cmd, LIGHTNINGD, "Malformed gossip_getnodes response")); return; @@ -286,7 +286,7 @@ static struct command_result *json_listnodes(struct command *cmd, NULL)) return command_param_failed(); - req = towire_gossip_getnodes_request(cmd, id); + req = towire_gossipd_getnodes_request(cmd, id); subd_req(cmd, cmd->ld->gossip, req, -1, 0, json_getnodes_reply, cmd); return command_still_pending(cmd); } @@ -348,7 +348,7 @@ static void json_getroute_reply(struct subd *gossip UNUSED, const u8 *reply, con struct json_stream *response; struct route_hop **hops; - fromwire_gossip_getroute_reply(reply, reply, &hops); + fromwire_gossipd_getroute_reply(reply, reply, &hops); if (tal_count(hops) == 0) { was_pending(command_fail(cmd, PAY_ROUTE_NOT_FOUND, @@ -434,7 +434,7 @@ static struct command_result *json_getroute(struct command *cmd, excluded = NULL; } - u8 *req = towire_gossip_getroute_request( + u8 *req = towire_gossipd_getroute_request( cmd, source, destination, *msat, *riskfactor_millionths, *cltv, *fuzz_millionths, excluded, *max_hops); subd_req(ld->gossip, ld->gossip, req, -1, 0, json_getroute_reply, cmd); @@ -501,7 +501,7 @@ static void json_listchannels_reply(struct subd *gossip UNUSED, const u8 *reply, struct gossip_getchannels_entry **entries; bool complete; - if (!fromwire_gossip_getchannels_reply(reply, reply, + if (!fromwire_gossipd_getchannels_reply(reply, reply, &complete, &entries)) { /* Shouldn't happen: just end json stream. */ log_broken(linfo->cmd->ld->log, "Invalid reply from gossipd"); @@ -518,7 +518,7 @@ static void json_listchannels_reply(struct subd *gossip UNUSED, const u8 *reply, if (!complete) { u8 *req; assert(tal_count(entries) != 0); - req = towire_gossip_getchannels_request(linfo->cmd, + req = towire_gossipd_getchannels_request(linfo->cmd, linfo->id, linfo->source, &entries[i-1] @@ -554,7 +554,7 @@ static struct command_result *json_listchannels(struct command *cmd, linfo->response = json_stream_success(cmd); json_array_start(linfo->response, "channels"); - req = towire_gossip_getchannels_request(cmd, linfo->id, linfo->source, + req = towire_gossipd_getchannels_request(cmd, linfo->id, linfo->source, NULL); subd_req(cmd->ld->gossip, cmd->ld->gossip, req, -1, 0, json_listchannels_reply, linfo); @@ -585,7 +585,7 @@ json_dev_set_max_scids_encode_size(struct command *cmd, NULL)) return command_param_failed(); - msg = towire_gossip_dev_set_max_scids_encode_size(NULL, *max); + msg = towire_gossipd_dev_set_max_scids_encode_size(NULL, *max); subd_send_msg(cmd->ld->gossip, take(msg)); return command_success(cmd, json_stream_success(cmd)); @@ -607,7 +607,7 @@ static struct command_result *json_dev_suppress_gossip(struct command *cmd, if (!param(cmd, buffer, params, NULL)) return command_param_failed(); - subd_send_msg(cmd->ld->gossip, take(towire_gossip_dev_suppress(NULL))); + subd_send_msg(cmd->ld->gossip, take(towire_gossipd_dev_suppress(NULL))); return command_success(cmd, json_stream_success(cmd)); } @@ -627,7 +627,7 @@ static void dev_compact_gossip_store_reply(struct subd *gossip UNUSED, { bool success; - if (!fromwire_gossip_dev_compact_store_reply(reply, &success)) { + if (!fromwire_gossipd_dev_compact_store_reply(reply, &success)) { was_pending(command_fail(cmd, LIGHTNINGD, "Gossip gave bad dev_gossip_compact_store_reply")); return; @@ -649,7 +649,7 @@ static struct command_result *json_dev_compact_gossip_store(struct command *cmd, if (!param(cmd, buffer, params, NULL)) return command_param_failed(); - msg = towire_gossip_dev_compact_store(NULL); + msg = towire_gossipd_dev_compact_store(NULL); subd_req(cmd->ld->gossip, cmd->ld->gossip, take(msg), -1, 0, dev_compact_gossip_store_reply, cmd); return command_still_pending(cmd); @@ -676,7 +676,7 @@ static struct command_result *json_dev_gossip_set_time(struct command *cmd, NULL)) return command_param_failed(); - msg = towire_gossip_dev_set_time(NULL, *time); + msg = towire_gossipd_dev_set_time(NULL, *time); subd_send_msg(cmd->ld->gossip, take(msg)); return command_success(cmd, json_stream_success(cmd)); diff --git a/lightningd/invoice.c b/lightningd/invoice.c index b8596c495..c68c22fca 100644 --- a/lightningd/invoice.c +++ b/lightningd/invoice.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include @@ -635,7 +635,7 @@ static void gossipd_incoming_channels_reply(struct subd *gossipd, struct wallet *wallet = info->cmd->ld->wallet; const struct chanhints *chanhints = info->chanhints; - if (!fromwire_gossip_get_incoming_channels_reply(tmpctx, msg, + if (!fromwire_gossipd_get_incoming_channels_reply(tmpctx, msg, &inchans, &inchan_deadends, &private, @@ -1056,7 +1056,7 @@ static struct command_result *json_invoice(struct command *cmd, info->b11->fallbacks = tal_steal(info->b11, fallback_scripts); subd_req(cmd, cmd->ld->gossip, - take(towire_gossip_get_incoming_channels(NULL)), + take(towire_gossipd_get_incoming_channels(NULL)), -1, 0, gossipd_incoming_channels_reply, info); return command_still_pending(cmd); diff --git a/lightningd/memdump.c b/lightningd/memdump.c index f0bf7a55d..f4faeeb77 100644 --- a/lightningd/memdump.c +++ b/lightningd/memdump.c @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include @@ -227,7 +227,7 @@ static void gossip_dev_memleak_done(struct subd *gossipd, { bool found_leak; - if (!fromwire_gossip_dev_memleak_reply(reply, &found_leak)) { + if (!fromwire_gossipd_dev_memleak_reply(reply, &found_leak)) { was_pending(command_fail(cmd, LIGHTNINGD, "Bad gossip_dev_memleak")); return; @@ -277,7 +277,7 @@ static void hsm_dev_memleak_done(struct subd *hsmd, } /* No leak? Ask gossipd. */ - subd_req(ld->gossip, ld->gossip, take(towire_gossip_dev_memleak(NULL)), + subd_req(ld->gossip, ld->gossip, take(towire_gossipd_dev_memleak(NULL)), -1, 0, gossip_dev_memleak_done, cmd); } diff --git a/lightningd/pay.c b/lightningd/pay.c index 44a8653c9..6d015ca95 100644 --- a/lightningd/pay.c +++ b/lightningd/pay.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include @@ -459,7 +459,7 @@ remote_routing_failure(const tal_t *ctx, /* FIXME: sendonion caller should do this, and inform gossipd of any * permanent errors. */ subd_send_msg(ld->gossip, - take(towire_gossip_payment_failure(NULL, failuremsg))); + take(towire_gossipd_payment_failure(NULL, failuremsg))); routing_failure->erring_index = (unsigned int) (origin_index + 1); routing_failure->failcode = failcode; diff --git a/lightningd/peer_htlcs.c b/lightningd/peer_htlcs.c index 378fad3ee..946c8eab3 100644 --- a/lightningd/peer_htlcs.c +++ b/lightningd/peer_htlcs.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include @@ -164,7 +164,7 @@ static void failmsg_update_reply(struct subd *gossipd, struct failed_htlc *failed_htlc; /* This can happen because channel never got properly announced.*/ - if (!fromwire_gossip_get_stripped_cupdate_reply(msg, msg, + if (!fromwire_gossipd_get_stripped_cupdate_reply(msg, msg, &stripped_update) || !tal_count(stripped_update)) { failmsg = towire_temporary_node_failure(NULL); @@ -277,7 +277,7 @@ void local_fail_in_htlc_needs_update(struct htlc_in *hin, cbdata->failmsg_needs_update = tal_dup_talarr(cbdata, u8, failmsg_needs_update); subd_req(cbdata, hin->key.channel->peer->ld->gossip, - take(towire_gossip_get_stripped_cupdate(NULL, failmsg_scid)), + take(towire_gossipd_get_stripped_cupdate(NULL, failmsg_scid)), -1, 0, failmsg_update_reply, cbdata); } diff --git a/lightningd/ping.c b/lightningd/ping.c index 207477da8..fd7337b4f 100644 --- a/lightningd/ping.c +++ b/lightningd/ping.c @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include #include @@ -60,7 +60,7 @@ void ping_reply(struct subd *subd, const u8 *msg) struct ping_command *pc; log_debug(subd->ld->log, "Got ping reply!"); - ok = fromwire_gossip_ping_reply(msg, &id, &sent, &totlen); + ok = fromwire_gossipd_ping_reply(msg, &id, &sent, &totlen); pc = find_ping_cmd(subd->ld, &id); assert(pc); @@ -123,7 +123,7 @@ static struct command_result *json_ping(struct command *cmd, new_ping_command(cmd, cmd->ld, id, cmd); /* gossipd handles all pinging, even if it's in another daemon. */ - msg = towire_gossip_ping(NULL, id, *pongbytes, *len); + msg = towire_gossipd_ping(NULL, id, *pongbytes, *len); subd_send_msg(cmd->ld->gossip, take(msg)); return command_still_pending(cmd); } diff --git a/lightningd/signmessage.c b/lightningd/signmessage.c index 2cc524b13..92d3c91f9 100644 --- a/lightningd/signmessage.c +++ b/lightningd/signmessage.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include #include @@ -137,7 +137,7 @@ static void getnode_reply(struct subd *gossip UNUSED, const u8 *reply, struct gossip_getnodes_entry **nodes; struct json_stream *response; - if (!fromwire_gossip_getnodes_reply(reply, reply, &nodes)) { + if (!fromwire_gossipd_getnodes_reply(reply, reply, &nodes)) { log_broken(can->cmd->ld->log, "Malformed gossip_getnodes response %s", tal_hex(tmpctx, reply)); @@ -212,7 +212,7 @@ static struct command_result *json_checkmessage(struct command *cmd, node_id_from_pubkey(&can->id, &reckey); can->cmd = cmd; - req = towire_gossip_getnodes_request(cmd, &can->id); + req = towire_gossipd_getnodes_request(cmd, &can->id); subd_req(cmd, cmd->ld->gossip, req, -1, 0, getnode_reply, can); return command_still_pending(cmd); } diff --git a/lightningd/test/run-invoice-select-inchan.c b/lightningd/test/run-invoice-select-inchan.c index 7abcd7d1f..cf582ad74 100644 --- a/lightningd/test/run-invoice-select-inchan.c +++ b/lightningd/test/run-invoice-select-inchan.c @@ -116,9 +116,9 @@ bool fromwire_channeld_dev_memleak_reply(const void *p UNNEEDED, bool *leak UNNE /* Generated stub for fromwire_connect_peer_connected */ 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) { fprintf(stderr, "fromwire_connect_peer_connected called!\n"); abort(); } -/* Generated stub for fromwire_gossip_get_incoming_channels_reply */ -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) -{ fprintf(stderr, "fromwire_gossip_get_incoming_channels_reply called!\n"); abort(); } +/* Generated stub for fromwire_gossipd_get_incoming_channels_reply */ +bool fromwire_gossipd_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) +{ fprintf(stderr, "fromwire_gossipd_get_incoming_channels_reply called!\n"); abort(); } /* Generated stub for fromwire_hsmd_get_channel_basepoints_reply */ bool fromwire_hsmd_get_channel_basepoints_reply(const void *p UNNEEDED, struct basepoints *basepoints UNNEEDED, struct pubkey *funding_pubkey UNNEEDED) { fprintf(stderr, "fromwire_hsmd_get_channel_basepoints_reply called!\n"); abort(); } @@ -487,9 +487,9 @@ 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 */ -u8 *towire_gossip_get_incoming_channels(const tal_t *ctx UNNEEDED) -{ fprintf(stderr, "towire_gossip_get_incoming_channels called!\n"); abort(); } +/* Generated stub for towire_gossipd_get_incoming_channels */ +u8 *towire_gossipd_get_incoming_channels(const tal_t *ctx UNNEEDED) +{ fprintf(stderr, "towire_gossipd_get_incoming_channels called!\n"); abort(); } /* Generated stub for towire_hsmd_get_channel_basepoints */ u8 *towire_hsmd_get_channel_basepoints(const tal_t *ctx UNNEEDED, const struct node_id *peerid UNNEEDED, u64 dbid UNNEEDED) { fprintf(stderr, "towire_hsmd_get_channel_basepoints called!\n"); abort(); } diff --git a/openingd/Makefile b/openingd/Makefile index 14d1b25d5..bffc3dab3 100644 --- a/openingd/Makefile +++ b/openingd/Makefile @@ -82,7 +82,7 @@ OPENINGD_COMMON_OBJS := \ common/version.o \ common/wire_error.o \ common/wireaddr.o \ - gossipd/gen_gossip_peerd_wire.o \ + gossipd/gossipd_peerd_wiregen.o \ lightningd/gossip_msg.o $(LIGHTNINGD_OPENING_OBJS): $(LIGHTNINGD_HEADERS) diff --git a/openingd/openingd.c b/openingd/openingd.c index 7e2bcec45..3ac2cb657 100644 --- a/openingd/openingd.c +++ b/openingd/openingd.c @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/wallet/test/run-wallet.c b/wallet/test/run-wallet.c index 91c690495..4fd16eed8 100644 --- a/wallet/test/run-wallet.c +++ b/wallet/test/run-wallet.c @@ -132,9 +132,9 @@ bool fromwire_connect_peer_connected(const tal_t *ctx UNNEEDED, const void *p UN /* Generated stub for fromwire_custommsg_in */ bool fromwire_custommsg_in(const tal_t *ctx UNNEEDED, const void *p UNNEEDED, u8 **msg UNNEEDED) { fprintf(stderr, "fromwire_custommsg_in called!\n"); abort(); } -/* Generated stub for fromwire_gossip_get_stripped_cupdate_reply */ -bool fromwire_gossip_get_stripped_cupdate_reply(const tal_t *ctx UNNEEDED, const void *p UNNEEDED, u8 **stripped_update UNNEEDED) -{ fprintf(stderr, "fromwire_gossip_get_stripped_cupdate_reply called!\n"); abort(); } +/* Generated stub for fromwire_gossipd_get_stripped_cupdate_reply */ +bool fromwire_gossipd_get_stripped_cupdate_reply(const tal_t *ctx UNNEEDED, const void *p UNNEEDED, u8 **stripped_update UNNEEDED) +{ fprintf(stderr, "fromwire_gossipd_get_stripped_cupdate_reply called!\n"); abort(); } /* Generated stub for fromwire_hsmd_get_output_scriptpubkey_reply */ bool fromwire_hsmd_get_output_scriptpubkey_reply(const tal_t *ctx UNNEEDED, const void *p UNNEEDED, u8 **script UNNEEDED) { fprintf(stderr, "fromwire_hsmd_get_output_scriptpubkey_reply called!\n"); abort(); } @@ -693,9 +693,9 @@ u8 *towire_final_incorrect_cltv_expiry(const tal_t *ctx UNNEEDED, u32 cltv_expir /* Generated stub for towire_final_incorrect_htlc_amount */ u8 *towire_final_incorrect_htlc_amount(const tal_t *ctx UNNEEDED, struct amount_msat incoming_htlc_amt UNNEEDED) { fprintf(stderr, "towire_final_incorrect_htlc_amount called!\n"); abort(); } -/* Generated stub for towire_gossip_get_stripped_cupdate */ -u8 *towire_gossip_get_stripped_cupdate(const tal_t *ctx UNNEEDED, const struct short_channel_id *channel_id UNNEEDED) -{ fprintf(stderr, "towire_gossip_get_stripped_cupdate called!\n"); abort(); } +/* Generated stub for towire_gossipd_get_stripped_cupdate */ +u8 *towire_gossipd_get_stripped_cupdate(const tal_t *ctx UNNEEDED, const struct short_channel_id *channel_id UNNEEDED) +{ fprintf(stderr, "towire_gossipd_get_stripped_cupdate called!\n"); abort(); } /* Generated stub for towire_hsmd_get_output_scriptpubkey */ u8 *towire_hsmd_get_output_scriptpubkey(const tal_t *ctx UNNEEDED, u64 channel_id UNNEEDED, const struct node_id *peer_id UNNEEDED, const struct pubkey *commitment_point UNNEEDED) { fprintf(stderr, "towire_hsmd_get_output_scriptpubkey called!\n"); abort(); }