mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-01 17:47:30 +01:00
gossipd: naming cleanups.
Suggested-by: @cdecker. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
39c9dcbafc
commit
6a8d18c7e3
6 changed files with 16 additions and 16 deletions
|
@ -17,7 +17,7 @@ LIGHTNINGD_GOSSIP_HEADERS_WSRC := gossipd/gen_gossip_wire.h \
|
||||||
gossipd/gen_gossip_store.h \
|
gossipd/gen_gossip_store.h \
|
||||||
gossipd/gossipd.h \
|
gossipd/gossipd.h \
|
||||||
gossipd/gossip_store.h \
|
gossipd/gossip_store.h \
|
||||||
gossipd/make_gossip.h \
|
gossipd/gossip_generation.h \
|
||||||
gossipd/routing.h
|
gossipd/routing.h
|
||||||
LIGHTNINGD_GOSSIP_HEADERS := $(LIGHTNINGD_GOSSIP_HEADERS_WSRC) gossipd/broadcast.h
|
LIGHTNINGD_GOSSIP_HEADERS := $(LIGHTNINGD_GOSSIP_HEADERS_WSRC) gossipd/broadcast.h
|
||||||
LIGHTNINGD_GOSSIP_SRC := $(LIGHTNINGD_GOSSIP_HEADERS_WSRC:.h=.c)
|
LIGHTNINGD_GOSSIP_SRC := $(LIGHTNINGD_GOSSIP_HEADERS_WSRC:.h=.c)
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
/* Routines to make our own gossip messages */
|
/* Routines to make our own gossip messages. Not as in "we're the gossip
|
||||||
|
* generation, man!" */
|
||||||
#include <ccan/mem/mem.h>
|
#include <ccan/mem/mem.h>
|
||||||
#include <common/memleak.h>
|
#include <common/memleak.h>
|
||||||
#include <common/timeout.h>
|
#include <common/timeout.h>
|
||||||
|
@ -6,9 +7,9 @@
|
||||||
#include <common/wireaddr.h>
|
#include <common/wireaddr.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <gossipd/gen_gossip_peerd_wire.h>
|
#include <gossipd/gen_gossip_peerd_wire.h>
|
||||||
|
#include <gossipd/gossip_generation.h>
|
||||||
#include <gossipd/gossip_store.h>
|
#include <gossipd/gossip_store.h>
|
||||||
#include <gossipd/gossipd.h>
|
#include <gossipd/gossipd.h>
|
||||||
#include <gossipd/make_gossip.h>
|
|
||||||
#include <hsmd/gen_hsm_wire.h>
|
#include <hsmd/gen_hsm_wire.h>
|
||||||
#include <wire/gen_peer_wire.h>
|
#include <wire/gen_peer_wire.h>
|
||||||
#include <wire/wire_sync.h>
|
#include <wire/wire_sync.h>
|
|
@ -1,5 +1,5 @@
|
||||||
#ifndef LIGHTNING_GOSSIPD_MAKE_GOSSIP_H
|
#ifndef LIGHTNING_GOSSIPD_GOSSIP_GENERATION_H
|
||||||
#define LIGHTNING_GOSSIPD_MAKE_GOSSIP_H
|
#define LIGHTNING_GOSSIPD_GOSSIP_GENERATION_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <ccan/short_types/short_types.h>
|
#include <ccan/short_types/short_types.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
@ -44,4 +44,4 @@ bool handle_local_channel_update(struct daemon *daemon,
|
||||||
const struct node_id *src,
|
const struct node_id *src,
|
||||||
const u8 *msg);
|
const u8 *msg);
|
||||||
|
|
||||||
#endif /* LIGHTNING_GOSSIPD_MAKE_GOSSIP_H */
|
#endif /* LIGHTNING_GOSSIPD_GOSSIP_GENERATION_H */
|
|
@ -52,8 +52,8 @@
|
||||||
#include <gossipd/broadcast.h>
|
#include <gossipd/broadcast.h>
|
||||||
#include <gossipd/gen_gossip_peerd_wire.h>
|
#include <gossipd/gen_gossip_peerd_wire.h>
|
||||||
#include <gossipd/gen_gossip_wire.h>
|
#include <gossipd/gen_gossip_wire.h>
|
||||||
|
#include <gossipd/gossip_generation.h>
|
||||||
#include <gossipd/gossipd.h>
|
#include <gossipd/gossipd.h>
|
||||||
#include <gossipd/make_gossip.h>
|
|
||||||
#include <gossipd/routing.h>
|
#include <gossipd/routing.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <lightningd/gossip_msg.h>
|
#include <lightningd/gossip_msg.h>
|
||||||
|
@ -1454,7 +1454,7 @@ static void dump_gossip(struct peer *peer)
|
||||||
* sets the UPDATE bit in the error type. lightningd is too important to
|
* sets the UPDATE bit in the error type. lightningd is too important to
|
||||||
* fetch this itself, so channeld does it (channeld has to talk to us for
|
* fetch this itself, so channeld does it (channeld has to talk to us for
|
||||||
* other things anyway, so why not?). */
|
* other things anyway, so why not?). */
|
||||||
static bool handle_get_update(struct peer *peer, const u8 *msg)
|
static bool handle_get_local_channel_update(struct peer *peer, const u8 *msg)
|
||||||
{
|
{
|
||||||
struct short_channel_id scid;
|
struct short_channel_id scid;
|
||||||
struct local_chan *local_chan;
|
struct local_chan *local_chan;
|
||||||
|
@ -1572,7 +1572,7 @@ static struct io_plan *peer_msg_in(struct io_conn *conn,
|
||||||
/* Must be a gossip_peerd_wire_type asking us to do something. */
|
/* Must be a gossip_peerd_wire_type asking us to do something. */
|
||||||
switch ((enum gossip_peerd_wire_type)fromwire_peektype(msg)) {
|
switch ((enum gossip_peerd_wire_type)fromwire_peektype(msg)) {
|
||||||
case WIRE_GOSSIPD_GET_UPDATE:
|
case WIRE_GOSSIPD_GET_UPDATE:
|
||||||
ok = handle_get_update(peer, msg);
|
ok = handle_get_local_channel_update(peer, msg);
|
||||||
goto handled_cmd;
|
goto handled_cmd;
|
||||||
case WIRE_GOSSIPD_LOCAL_ADD_CHANNEL:
|
case WIRE_GOSSIPD_LOCAL_ADD_CHANNEL:
|
||||||
ok = handle_local_add_channel(peer->daemon->rstate, msg, 0);
|
ok = handle_local_add_channel(peer->daemon->rstate, msg, 0);
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
#include <gossipd/gen_gossip_peerd_wire.h>
|
#include <gossipd/gen_gossip_peerd_wire.h>
|
||||||
#include <gossipd/gen_gossip_store.h>
|
#include <gossipd/gen_gossip_store.h>
|
||||||
#include <gossipd/gen_gossip_wire.h>
|
#include <gossipd/gen_gossip_wire.h>
|
||||||
#include <gossipd/make_gossip.h>
|
#include <gossipd/gossip_generation.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <wire/gen_peer_wire.h>
|
#include <wire/gen_peer_wire.h>
|
||||||
|
|
||||||
|
@ -485,8 +485,8 @@ static void destroy_local_chan(struct local_chan *local_chan,
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct local_chan *new_local_chan(struct routing_state *rstate,
|
static void maybe_add_local_chan(struct routing_state *rstate,
|
||||||
struct chan *chan)
|
struct chan *chan)
|
||||||
{
|
{
|
||||||
int direction;
|
int direction;
|
||||||
struct local_chan *local_chan;
|
struct local_chan *local_chan;
|
||||||
|
@ -496,7 +496,7 @@ static struct local_chan *new_local_chan(struct routing_state *rstate,
|
||||||
else if (node_id_eq(&chan->nodes[1]->id, &rstate->local_id))
|
else if (node_id_eq(&chan->nodes[1]->id, &rstate->local_id))
|
||||||
direction = 1;
|
direction = 1;
|
||||||
else
|
else
|
||||||
return NULL;
|
return;
|
||||||
|
|
||||||
local_chan = tal(chan, struct local_chan);
|
local_chan = tal(chan, struct local_chan);
|
||||||
local_chan->chan = chan;
|
local_chan->chan = chan;
|
||||||
|
@ -506,7 +506,6 @@ static struct local_chan *new_local_chan(struct routing_state *rstate,
|
||||||
|
|
||||||
local_chan_map_add(&rstate->local_chan_map, local_chan);
|
local_chan_map_add(&rstate->local_chan_map, local_chan);
|
||||||
tal_add_destructor2(local_chan, destroy_local_chan, rstate);
|
tal_add_destructor2(local_chan, destroy_local_chan, rstate);
|
||||||
return local_chan;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct chan *new_chan(struct routing_state *rstate,
|
struct chan *new_chan(struct routing_state *rstate,
|
||||||
|
@ -551,7 +550,7 @@ struct chan *new_chan(struct routing_state *rstate,
|
||||||
uintmap_add(&rstate->chanmap, scid->u64, chan);
|
uintmap_add(&rstate->chanmap, scid->u64, chan);
|
||||||
|
|
||||||
/* Initialize shadow structure if it's local */
|
/* Initialize shadow structure if it's local */
|
||||||
new_local_chan(rstate, chan);
|
maybe_add_local_chan(rstate, chan);
|
||||||
return chan;
|
return chan;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
int unused_main(int argc, char *argv[]);
|
int unused_main(int argc, char *argv[]);
|
||||||
#define main unused_main
|
#define main unused_main
|
||||||
#include "../gossipd.c"
|
#include "../gossipd.c"
|
||||||
#include "../make_gossip.c"
|
#include "../gossip_generation.c"
|
||||||
#undef main
|
#undef main
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue