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. */
| 2319 | * worth keeping track of where that starts, so we can skip most of |
| 2320 | * the store. */ |
| 2321 | void update_recent_timestamp(struct daemon *daemon, struct gossmap *gossmap) |
| 2322 | { |
| 2323 | /* 2 hours allows for some clock drift, not too much gossip */ |
| 2324 | u32 recent = clock_time().ts.tv_sec - 7200; |
| 2325 | |
| 2326 | /* Only update every minute */ |
| 2327 | if (daemon->gossip_recent_time + 60 > recent) |
| 2328 | return; |
| 2329 | |
| 2330 | daemon->gossip_recent_time = recent; |
| 2331 | gossmap_iter_fast_forward(gossmap, |
| 2332 | daemon->gossmap_iter_recent, |
| 2333 | recent); |
| 2334 | } |
| 2335 | |
| 2336 | static void connectd_logcb(struct daemon *daemon, |
| 2337 | enum log_level level, |
no test coverage detected