MCPcopy Create free account
hub / github.com/ElementsProject/lightning / timestamp_reasonable

Function timestamp_reasonable

gossipd/routing.c:215–226  ·  view source on GitHub ↗

We don't check this when loading from the gossip_store: that would break * our canned tests, and usually old gossip is better than no gossip */

Source from the content-addressed store, hash-verified

213/* We don't check this when loading from the gossip_store: that would break
214 * our canned tests, and usually old gossip is better than no gossip */
215static bool timestamp_reasonable(struct routing_state *rstate, u32 timestamp)
216{
217 u64 now = gossip_time_now(rstate).ts.tv_sec;
218
219 /* More than one day ahead? */
220 if (timestamp > now + 24*60*60)
221 return false;
222 /* More than 2 weeks behind? */
223 if (timestamp < now - GOSSIP_PRUNE_INTERVAL(rstate->dev_fast_gossip_prune))
224 return false;
225 return true;
226}
227
228#if DEVELOPER
229static void memleak_help_routing_tables(struct htable *memtable,

Callers 1

Calls 1

gossip_time_nowFunction · 0.70

Tested by

no test coverage detected