gossipd: actually update own node announcement if needed

When an outdated own node announcement is present, it fails the
nannounce_different test and also fails to kick off the forced regen
timer.

Changelog-Fixed: Node announcements are refreshed more reliably.
This commit is contained in:
Alex Myers 2023-07-27 15:08:00 -05:00 committed by Rusty Russell
parent a9565f5589
commit 8f196b2d7b
1 changed files with 5 additions and 0 deletions

View File

@ -287,6 +287,11 @@ static bool update_own_node_announcement(struct daemon *daemon,
&only_missing_tlv)) {
if (always_refresh)
goto send;
/* Update if old announcement is at least 7 days old. */
if (timestamp > self->bcast.timestamp &&
timestamp - self->bcast.timestamp >
GOSSIP_PRUNE_INTERVAL(daemon->rstate->dev_fast_gossip_prune) / 2)
goto send;
return false;
}