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

Function timestamp_reasonable

gossipd/gossmap_manage.c:997–1008  ·  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

995/* We don't check this when loading from the gossip_store: that would break
996 * our canned tests, and usually old gossip is better than no gossip */
997static bool timestamp_reasonable(const struct daemon *daemon, u32 timestamp)
998{
999 u64 now = clock_time().ts.tv_sec;
1000
1001 /* More than one day ahead? */
1002 if (timestamp > now + 24*60*60)
1003 return false;
1004 /* More than 2 weeks behind? */
1005 if (timestamp < now - GOSSIP_PRUNE_INTERVAL(daemon->dev_fast_gossip_prune))
1006 return false;
1007 return true;
1008}
1009
1010const char *gossmap_manage_channel_update(const tal_t *ctx,
1011 struct gossmap_manage *gm,

Callers 1

Calls 1

clock_timeFunction · 0.85

Tested by

no test coverage detected