From d22fd599973175e3d1a484a7aa2efd9916116bc5 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Sat, 4 Dec 2021 21:57:32 +1030 Subject: [PATCH] gossipd: remove gossip_msg.[ch] This was a remnant from when we used to get routing from gossipd. Signed-off-by: Rusty Russell --- channeld/Makefile | 1 - connectd/Makefile | 1 - connectd/connectd.c | 2 ++ connectd/connectd_wire.csv | 3 ++- gossipd/Makefile | 1 - gossipd/gossipd.c | 2 +- lightningd/Makefile | 1 - lightningd/gossip_msg.c | 24 --------------------- lightningd/gossip_msg.h | 44 -------------------------------------- 9 files changed, 5 insertions(+), 74 deletions(-) delete mode 100644 lightningd/gossip_msg.c delete mode 100644 lightningd/gossip_msg.h diff --git a/channeld/Makefile b/channeld/Makefile index 5e7626c37..6f26ef416 100644 --- a/channeld/Makefile +++ b/channeld/Makefile @@ -92,7 +92,6 @@ CHANNELD_COMMON_OBJS := \ common/wireaddr.o \ gossipd/gossipd_peerd_wiregen.o \ gossipd/gossip_store_wiregen.o \ - lightningd/gossip_msg.o \ wire/fromwire.o \ wire/towire.o diff --git a/connectd/Makefile b/connectd/Makefile index 8e17d4c17..76cb7079f 100644 --- a/connectd/Makefile +++ b/connectd/Makefile @@ -71,7 +71,6 @@ CONNECTD_COMMON_OBJS := \ common/wireaddr.o \ common/wire_error.o \ gossipd/gossipd_wiregen.o \ - lightningd/gossip_msg.o \ wire/onion$(EXP)_wiregen.o lightningd/lightning_connectd: $(CONNECTD_OBJS) $(CONNECTD_COMMON_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) $(HSMD_CLIENT_OBJS) diff --git a/connectd/connectd.c b/connectd/connectd.c index 3bebaae02..1a2130a8b 100644 --- a/connectd/connectd.c +++ b/connectd/connectd.c @@ -10,7 +10,9 @@ #include "config.h" #include #include +#include #include +#include #include #include #include diff --git a/connectd/connectd_wire.csv b/connectd/connectd_wire.csv index 0719838d3..bddaf972a 100644 --- a/connectd/connectd_wire.csv +++ b/connectd/connectd_wire.csv @@ -1,8 +1,9 @@ +#include #include #include +#include #include #include -#include msgtype,connectd_init,2000 msgdata,connectd_init,chainparams,chainparams, diff --git a/gossipd/Makefile b/gossipd/Makefile index 465c4bb6f..f31acfe92 100644 --- a/gossipd/Makefile +++ b/gossipd/Makefile @@ -75,7 +75,6 @@ GOSSIPD_COMMON_OBJS := \ common/wireaddr.o \ common/wire_error.o \ connectd/connectd_gossipd_wiregen.o \ - lightningd/gossip_msg.o \ wire/onion$(EXP)_wiregen.o lightningd/lightning_gossipd: $(GOSSIPD_OBJS) $(GOSSIPD_COMMON_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) $(HSMD_CLIENT_OBJS) diff --git a/gossipd/gossipd.c b/gossipd/gossipd.c index 6b1c7a4ab..250cd7f4f 100644 --- a/gossipd/gossipd.c +++ b/gossipd/gossipd.c @@ -34,8 +34,8 @@ #include #include #include +#include #include -#include #include /*~ A channel consists of a `struct half_chan` for each direction, each of diff --git a/lightningd/Makefile b/lightningd/Makefile index 898b0b44c..2cdb6b0d0 100644 --- a/lightningd/Makefile +++ b/lightningd/Makefile @@ -11,7 +11,6 @@ LIGHTNINGD_SRC := \ lightningd/connect_control.c \ lightningd/onion_message.c \ lightningd/gossip_control.c \ - lightningd/gossip_msg.c \ lightningd/hsm_control.c \ lightningd/htlc_end.c \ lightningd/htlc_set.c \ diff --git a/lightningd/gossip_msg.c b/lightningd/gossip_msg.c deleted file mode 100644 index 9e74c5904..000000000 --- a/lightningd/gossip_msg.c +++ /dev/null @@ -1,24 +0,0 @@ -#include "config.h" -#include -#include -#include -#include -#include - -void fromwire_route_info(const u8 **pptr, size_t *max, struct route_info *entry) -{ - fromwire_node_id(pptr, max, &entry->pubkey); - fromwire_short_channel_id(pptr, max, &entry->short_channel_id); - entry->fee_base_msat = fromwire_u32(pptr, max); - entry->fee_proportional_millionths = fromwire_u32(pptr, max); - entry->cltv_expiry_delta = fromwire_u16(pptr, max); -} - -void towire_route_info(u8 **pptr, const struct route_info *entry) -{ - towire_node_id(pptr, &entry->pubkey); - towire_short_channel_id(pptr, &entry->short_channel_id); - towire_u32(pptr, entry->fee_base_msat); - towire_u32(pptr, entry->fee_proportional_millionths); - towire_u16(pptr, entry->cltv_expiry_delta); -} diff --git a/lightningd/gossip_msg.h b/lightningd/gossip_msg.h deleted file mode 100644 index 3e65236d6..000000000 --- a/lightningd/gossip_msg.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef LIGHTNING_LIGHTNINGD_GOSSIP_MSG_H -#define LIGHTNING_LIGHTNINGD_GOSSIP_MSG_H -#include "config.h" -#include -#include - -struct route_info; -struct lease_rates; - -struct gossip_getnodes_entry { - struct node_id nodeid; - s64 last_timestamp; /* -1 means never: following fields ignored */ - u8 *features; - struct wireaddr *addresses; - u8 alias[32]; - u8 color[3]; - struct lease_rates *rates; -}; - -struct gossip_halfchannel_entry { - u8 message_flags; - u8 channel_flags; - u32 last_update_timestamp; - u32 delay; - u32 base_fee_msat; - u32 fee_per_millionth; - struct amount_msat min, max; -}; - -struct gossip_getchannels_entry { - struct node_id node[2]; - struct amount_sat sat; - struct short_channel_id short_channel_id; - bool public; - bool local_disabled; - /* NULL if we haven't received an update */ - struct gossip_halfchannel_entry *e[2]; - u8 *features; -}; - -void fromwire_route_info(const u8 **pprt, size_t *max, struct route_info *entry); -void towire_route_info(u8 **pprt, const struct route_info *entry); - -#endif /* LIGHTNING_LIGHTNINGD_GOSSIP_MSG_H */