Browse Source

gossipd: add txout_failure when a close is seen.

This prevents a gratuitous lookup of we get a late channel_announce,
but even better, it suppresses the "bad gossip" messages in case of
a late channel_update, which have plagued Travis (especially since we
got aggressive in pushing our own updates).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
travis-debug
Rusty Russell 5 years ago
parent
commit
5a8677edc6
  1. 2
      gossipd/gossipd.c
  2. 4
      gossipd/routing.c
  3. 4
      gossipd/routing.h

2
gossipd/gossipd.c

@ -1517,6 +1517,8 @@ static struct io_plan *handle_outpoint_spent(struct io_conn *conn,
"Deleting channel %s due to the funding outpoint being "
"spent",
type_to_string(msg, struct short_channel_id, &scid));
/* Suppress any now-obsolete updates/announcements */
add_to_txout_failures(rstate, &scid);
remove_channel_from_store(rstate, chan);
/* Freeing is sufficient since everything else is allocated off
* of the channel and this takes care of unregistering

4
gossipd/routing.c

@ -258,8 +258,8 @@ static void txout_failure_age(struct routing_state *rstate)
txout_failure_age, rstate);
}
static void add_to_txout_failures(struct routing_state *rstate,
const struct short_channel_id *scid)
void add_to_txout_failures(struct routing_state *rstate,
const struct short_channel_id *scid)
{
if (uintmap_add(&rstate->txout_failures, scid->u64, true)
&& ++rstate->num_txout_failures == 10000) {

4
gossipd/routing.h

@ -529,4 +529,8 @@ void remove_channel_from_store(struct routing_state *rstate,
const char *unfinalized_entries(const tal_t *ctx, struct routing_state *rstate);
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);
#endif /* LIGHTNING_GOSSIPD_ROUTING_H */

Loading…
Cancel
Save