X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fsnapshot.rs;h=63975becd74204e732dbbd50c659cf45786a4cac;hb=561c7f8f9dfb64d1bf408cacdcaa676360c2d052;hp=05cc63e3222c4181944a571572efa45fab6df4da;hpb=cf326fd7a9f42c58a24788943745f066ecb5f641;p=rapid-gossip-sync-server diff --git a/src/snapshot.rs b/src/snapshot.rs index 05cc63e..63975be 100644 --- a/src/snapshot.rs +++ b/src/snapshot.rs @@ -11,13 +11,14 @@ use lightning::util::logger::Logger; use crate::config; use crate::config::cache_path; -pub(crate) struct Snapshotter where L::Target: Logger { +pub(crate) struct Snapshotter where L::Target: Logger { network_graph: Arc>, + logger: L } -impl Snapshotter where L::Target: Logger { - pub fn new(network_graph: Arc>) -> Self { - Self { network_graph } +impl Snapshotter where L::Target: Logger { + pub fn new(network_graph: Arc>, logger: L) -> Self { + Self { network_graph, logger } } pub(crate) async fn snapshot_gossip(&self) { @@ -79,7 +80,7 @@ impl Snapshotter where L::Target: Logger { { println!("Calculating {}-day snapshot", day_range); // calculate the snapshot - let snapshot = super::serialize_delta(network_graph_clone, current_last_sync_timestamp.clone() as u32).await; + let snapshot = super::serialize_delta(network_graph_clone, current_last_sync_timestamp.clone() as u32, self.logger.clone()).await; // persist the snapshot and update the symlink let snapshot_filename = format!("snapshot__calculated-at:{}__range:{}-days__previous-sync:{}.lngossip", reference_timestamp, day_range, current_last_sync_timestamp);