It's so common to ask for "recent" gossip (we ask for 10 minutes * ago, LND and Eclair ask for now, LDK asks for 1 hour ago) that it's * worth keeping track of where that starts, so we can skip most of * the store. */
| 2264 | * worth keeping track of where that starts, so we can skip most of |
| 2265 | * the store. */ |
| 2266 | void update_recent_timestamp(struct daemon *daemon, struct gossmap *gossmap) |
| 2267 | { |
| 2268 | /* 2 hours allows for some clock drift, not too much gossip */ |
| 2269 | u32 recent = clock_time().ts.tv_sec - 7200; |
| 2270 | |
| 2271 | /* Only update every minute */ |
| 2272 | if (daemon->gossip_recent_time + 60 > recent) |
| 2273 | return; |
| 2274 | |
| 2275 | daemon->gossip_recent_time = recent; |
| 2276 | gossmap_iter_fast_forward(gossmap, |
| 2277 | daemon->gossmap_iter_recent, |
| 2278 | recent); |
| 2279 | } |
| 2280 | |
| 2281 | static void connectd_logcb(struct daemon *daemon, |
| 2282 | enum log_level level, |
no test coverage detected