@ -207,7 +207,7 @@ static bool timestamp_reasonable(struct routing_state *rstate, u32 timestamp)
if ( timestamp > now + 24 * 60 * 60 )
return false ;
/* More than 2 weeks behind? */
if ( timestamp < now - GOSSIP_PRUNE_INTERVAL ( rstate - > dev_fast_gossip ) )
if ( timestamp < now - GOSSIP_PRUNE_INTERVAL ( rstate - > dev_fast_gossip_prune ) )
return false ;
return true ;
}
@ -238,7 +238,8 @@ struct routing_state *new_routing_state(const tal_t *ctx,
const struct node_id * local_id ,
struct list_head * peers ,
const u32 * dev_gossip_time TAKES ,
bool dev_fast_gossip )
bool dev_fast_gossip ,
bool dev_fast_gossip_prune )
{
struct routing_state * rstate = tal ( ctx , struct routing_state ) ;
rstate - > nodes = new_node_map ( rstate ) ;
@ -265,6 +266,7 @@ struct routing_state *new_routing_state(const tal_t *ctx,
} else
rstate - > gossip_time = NULL ;
rstate - > dev_fast_gossip = dev_fast_gossip ;
rstate - > dev_fast_gossip_prune = dev_fast_gossip_prune ;
# endif
tal_add_destructor ( rstate , destroy_routing_state ) ;
memleak_add_helper ( rstate , memleak_help_routing_tables ) ;
@ -2030,7 +2032,7 @@ bool routing_add_channel_update(struct routing_state *rstate,
}
/* Allow redundant updates once every 7 days */
if ( timestamp < hc - > bcast . timestamp + GOSSIP_PRUNE_INTERVAL ( rstate - > dev_fast_gossip ) / 2
if ( timestamp < hc - > bcast . timestamp + GOSSIP_PRUNE_INTERVAL ( rstate - > dev_fast_gossip_prune ) / 2
& & ! cupdate_different ( rstate - > gs , hc , update ) ) {
status_debug ( " Ignoring redundant update for %s/%u "
" (last %u, now %u) " ,
@ -2382,7 +2384,7 @@ bool routing_add_node_announcement(struct routing_state *rstate,
}
/* Allow redundant updates once every 7 days */
if ( timestamp < node - > bcast . timestamp + GOSSIP_PRUNE_INTERVAL ( rstate - > dev_fast_gossip ) / 2
if ( timestamp < node - > bcast . timestamp + GOSSIP_PRUNE_INTERVAL ( rstate - > dev_fast_gossip_prune ) / 2
& & ! nannounce_different ( rstate - > gs , node , msg ) ) {
status_debug ( " Ignoring redundant nannounce for %s "
" (last %u, now %u) " ,
@ -2730,7 +2732,7 @@ void route_prune(struct routing_state *rstate)
{
u64 now = gossip_time_now ( rstate ) . ts . tv_sec ;
/* Anything below this highwater mark ought to be pruned */
const s64 highwater = now - GOSSIP_PRUNE_INTERVAL ( rstate - > dev_fast_gossip ) ;
const s64 highwater = now - GOSSIP_PRUNE_INTERVAL ( rstate - > dev_fast_gossip_prune ) ;
struct chan * * pruned = tal_arr ( tmpctx , struct chan * , 0 ) ;
u64 idx ;