diff --git a/gossipd/gossipd.c b/gossipd/gossipd.c index c0040de7d..ed936807f 100644 --- a/gossipd/gossipd.c +++ b/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 diff --git a/gossipd/routing.c b/gossipd/routing.c index 18b3cc7be..2cfeccc7b 100644 --- a/gossipd/routing.c +++ b/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) { diff --git a/gossipd/routing.h b/gossipd/routing.h index 0880108d2..cf994511e 100644 --- a/gossipd/routing.h +++ b/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 */