Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove lnd gossip workaround, clean up for modern spec #4184

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions gossipd/gossipd.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
#include <sys/types.h>
#include <sys/un.h>
#include <unistd.h>
#include <wire/peer_wire.h>
#include <wire/wire_io.h>
#include <wire/wire_sync.h>

Expand Down Expand Up @@ -606,7 +605,7 @@ static struct io_plan *connectd_new_peer(struct io_conn *conn,
peer->scid_query_nodes = NULL;
peer->scid_query_nodes_idx = 0;
peer->scid_query_outstanding = false;
peer->query_channel_blocks = NULL;
peer->range_replies = NULL;
peer->query_channel_range_cb = NULL;
peer->num_pings_outstanding = 0;

Expand Down
17 changes: 9 additions & 8 deletions gossipd/gossipd.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
#define LIGHTNING_GOSSIPD_GOSSIPD_H
#include "config.h"
#include <bitcoin/block.h>
#include <ccan/bitmap/bitmap.h>
#include <ccan/list/list.h>
#include <ccan/short_types/short_types.h>
#include <ccan/timer/timer.h>
#include <common/bigsize.h>
#include <common/node_id.h>
#include <wire/peer_wire.h>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This created a duplicate import in gossipd.c line 67 which fails on the code checks.
I recommend removing it from the c file.


/* We talk to `hsmd` to sign our gossip messages with the node key */
#define HSM_FD 3
Expand Down Expand Up @@ -62,6 +62,11 @@ struct daemon {
struct feature_set *our_features;
};

struct range_query_reply {
struct short_channel_id scid;
struct channel_update_timestamps ts;
};

/* This represents each peer we're gossiping with */
struct peer {
/* daemon->peers */
Expand Down Expand Up @@ -95,17 +100,13 @@ struct peer {
/* How many pongs are we expecting? */
size_t num_pings_outstanding;

/* Map of outstanding channel_range requests. */
bitmap *query_channel_blocks;
/* What we're querying: [range_first_blocknum, range_end_blocknum) */
u32 range_first_blocknum, range_end_blocknum;
u32 range_blocks_remaining;
struct short_channel_id *query_channel_scids;
struct channel_update_timestamps *query_channel_timestamps;
u32 range_prev_end_blocknum;
struct range_query_reply *range_replies;
void (*query_channel_range_cb)(struct peer *peer,
u32 first_blocknum, u32 number_of_blocks,
const struct short_channel_id *scids,
const struct channel_update_timestamps *,
const struct range_query_reply *replies,
bool complete);

/* The daemon_conn used to queue messages to/from the peer. */
Expand Down
Loading