Prune the network graph immediately prior to generating updates
authorMatt Corallo <git@bluematt.me>
Thu, 27 Oct 2022 18:01:44 +0000 (18:01 +0000)
committerMatt Corallo <git@bluematt.me>
Thu, 27 Oct 2022 18:01:44 +0000 (18:01 +0000)
src/lib.rs

index bf61b40408db7e192604e5fe051a2ee22a56a9f2..cc5a350847e2c4c42322d2bf20545d5de900059a 100644 (file)
@@ -106,6 +106,8 @@ impl RapidSyncProcessor {
 async fn serialize_delta(network_graph: Arc<NetworkGraph<TestLogger>>, last_sync_timestamp: u32, consider_intermediate_updates: bool) -> SerializedResponse {
        let (client, connection) = lookup::connect_to_db().await;
 
+       network_graph.remove_stale_channels_and_tracking();
+
        tokio::spawn(async move {
                if let Err(e) = connection.await {
                        panic!("connection error: {}", e);