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

Function timestamp_reasonable

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

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

Callers 1

Calls 1

clock_timeFunction · 0.85

Tested by

no test coverage detected