gossipd: revert useless bf8cb640b7.

This attempted to make us re-xmit our own node_announcement at restart,
by moving the node_announcement to the end of the gossip store.  But,
as nothing is connected, yet, this had no effect!

We will rexmit it anyway, since it's marked PUSH.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2022-04-20 07:16:35 +09:30
parent cb70d06d67
commit ee21ae814a
5 changed files with 5 additions and 29 deletions

View file

@ -335,19 +335,9 @@ send:
return true;
}
/* This retransmits the existing node announcement */
static void force_self_nannounce_rexmit(struct daemon *daemon)
{
struct node *self = get_node(daemon->rstate, &daemon->id);
force_node_announce_rexmit(daemon->rstate, self);
}
static void update_own_node_announcement_after_startup(struct daemon *daemon)
{
/* If that doesn't send one, arrange rexmit anyway */
if (!update_own_node_announcement(daemon, false, false))
force_self_nannounce_rexmit(daemon);
update_own_node_announcement(daemon, false, false);
}
/* This creates and transmits a *new* node announcement */
@ -362,7 +352,7 @@ static void force_self_nannounce_regen(struct daemon *daemon)
update_own_node_announcement(daemon, false, true);
}
/* Because node_announcement propagation is spotty, we rexmit this every
/* Because node_announcement propagation is spotty, we regenerate this every
* 24 hours. */
static void setup_force_nannounce_regen_timer(struct daemon *daemon)
{
@ -386,11 +376,7 @@ void maybe_send_own_node_announce(struct daemon *daemon, bool startup)
if (!daemon->rstate->local_channel_announced)
return;
/* If we didn't send one, arrange rexmit of existing at startup */
if (!update_own_node_announcement(daemon, startup, false)) {
if (startup)
force_self_nannounce_rexmit(daemon);
}
update_own_node_announcement(daemon, startup, false);
}
/* Fast accessors for channel_update fields */

View file

@ -423,8 +423,8 @@ static bool node_announce_predates_channels(const struct node *node)
/* Move this node's announcement to the tail of the gossip_store, to
* make everyone send it again. */
void force_node_announce_rexmit(struct routing_state *rstate,
struct node *node)
static void force_node_announce_rexmit(struct routing_state *rstate,
struct node *node)
{
const u8 *announce;
bool is_local = node_id_eq(&node->id, &rstate->local_id);

View file

@ -406,8 +406,4 @@ void remove_all_gossip(struct routing_state *rstate);
/* This scid is dead to us. */
void add_to_txout_failures(struct routing_state *rstate,
const struct short_channel_id *scid);
/* Move this node's announcement to the tail of the gossip_store, to
* make everyone send it again. */
void force_node_announce_rexmit(struct routing_state *rstate, struct node *node);
#endif /* LIGHTNING_GOSSIPD_ROUTING_H */

View file

@ -33,9 +33,6 @@ void ecdh(const struct pubkey *point UNNEEDED, struct secret *ss UNNEEDED)
/* Generated stub for find_peer */
struct peer *find_peer(struct daemon *daemon UNNEEDED, const struct node_id *id UNNEEDED)
{ fprintf(stderr, "find_peer called!\n"); abort(); }
/* Generated stub for force_node_announce_rexmit */
void force_node_announce_rexmit(struct routing_state *rstate UNNEEDED, struct node *node UNNEEDED)
{ fprintf(stderr, "force_node_announce_rexmit called!\n"); abort(); }
/* Generated stub for fromwire_gossipd_local_channel_update */
bool fromwire_gossipd_local_channel_update(const void *p UNNEEDED, struct node_id *id 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(); }

View file

@ -51,9 +51,6 @@ void ecdh(const struct pubkey *point UNNEEDED, struct secret *ss UNNEEDED)
/* Generated stub for find_peer */
struct peer *find_peer(struct daemon *daemon UNNEEDED, const struct node_id *id UNNEEDED)
{ fprintf(stderr, "find_peer called!\n"); abort(); }
/* Generated stub for force_node_announce_rexmit */
void force_node_announce_rexmit(struct routing_state *rstate UNNEEDED, struct node *node UNNEEDED)
{ fprintf(stderr, "force_node_announce_rexmit 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(); }