mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
gossip: Clean up stale store
argument to handle_gossip_msg
This is a leftover from before splitting the `gossip_store` injection path from the handling of gossip messages. Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
parent
5f7b0fdf92
commit
81dc82de14
@ -612,8 +612,14 @@ static void send_node_announcement(struct daemon *daemon)
|
|||||||
tal_hex(tmpctx, err));
|
tal_hex(tmpctx, err));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns error if we should send an error. */
|
/**
|
||||||
static u8 *handle_gossip_msg(struct daemon *daemon, const u8 *msg, bool store)
|
* Handle an incoming gossip message
|
||||||
|
*
|
||||||
|
* Returns wire formatted error if handling failed. The error contains the
|
||||||
|
* details of the failures. The caller is expected to return the error to the
|
||||||
|
* peer, or drop the error if the message did not come from a peer.
|
||||||
|
*/
|
||||||
|
static u8 *handle_gossip_msg(struct daemon *daemon, const u8 *msg)
|
||||||
{
|
{
|
||||||
struct routing_state *rstate = daemon->rstate;
|
struct routing_state *rstate = daemon->rstate;
|
||||||
int t = fromwire_peektype(msg);
|
int t = fromwire_peektype(msg);
|
||||||
@ -743,7 +749,7 @@ static struct io_plan *peer_msgin(struct io_conn *conn,
|
|||||||
case WIRE_CHANNEL_ANNOUNCEMENT:
|
case WIRE_CHANNEL_ANNOUNCEMENT:
|
||||||
case WIRE_NODE_ANNOUNCEMENT:
|
case WIRE_NODE_ANNOUNCEMENT:
|
||||||
case WIRE_CHANNEL_UPDATE:
|
case WIRE_CHANNEL_UPDATE:
|
||||||
err = handle_gossip_msg(peer->daemon, msg, true);
|
err = handle_gossip_msg(peer->daemon, msg);
|
||||||
if (err)
|
if (err)
|
||||||
queue_peer_msg(peer, take(err));
|
queue_peer_msg(peer, take(err));
|
||||||
return peer_next_in(conn, peer);
|
return peer_next_in(conn, peer);
|
||||||
@ -926,7 +932,7 @@ static struct io_plan *owner_msg_in(struct io_conn *conn,
|
|||||||
int type = fromwire_peektype(msg);
|
int type = fromwire_peektype(msg);
|
||||||
if (type == WIRE_CHANNEL_ANNOUNCEMENT || type == WIRE_CHANNEL_UPDATE ||
|
if (type == WIRE_CHANNEL_ANNOUNCEMENT || type == WIRE_CHANNEL_UPDATE ||
|
||||||
type == WIRE_NODE_ANNOUNCEMENT) {
|
type == WIRE_NODE_ANNOUNCEMENT) {
|
||||||
err = handle_gossip_msg(peer->daemon, dc->msg_in, true);
|
err = handle_gossip_msg(peer->daemon, dc->msg_in);
|
||||||
if (err)
|
if (err)
|
||||||
queue_peer_msg(peer, take(err));
|
queue_peer_msg(peer, take(err));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user