X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=dnsseed-rust;a=blobdiff_plain;f=src%2Fdatastore.rs;h=30d2c8e8b21431cf917c0ec6d1436c7016f3a07c;hp=05d8a1e9ba0ef54fc0fa539899afda08ddf40a4e;hb=a264197c4fa7babe2ce2865f1b12e4db07ae687e;hpb=4dcc9a0bf74df2a63eb1376b3554f3dbb481d06b diff --git a/src/datastore.rs b/src/datastore.rs index 05d8a1e..30d2c8e 100644 --- a/src/datastore.rs +++ b/src/datastore.rs @@ -434,8 +434,12 @@ impl Store { tokio::fs::rename(nodes_file.clone() + ".tmp", nodes_file) }); + settings_future.join(nodes_future).then(|_| { future::ok(()) }) + } + + pub fn write_dns(&'static self) -> impl Future { let dns_file = self.store.clone() + "/nodes.dump"; - let dns_future = File::create(dns_file.clone() + ".tmp").and_then(move |f| { + File::create(dns_file.clone() + ".tmp").and_then(move |f| { let mut dns_buff = String::new(); { let mut rng = thread_rng(); @@ -505,9 +509,7 @@ impl Store { f.poll_sync_all() }).and_then(|_| { tokio::fs::rename(dns_file.clone() + ".tmp", dns_file) - }); - - settings_future.join3(nodes_future, dns_future).then(|_| { future::ok(()) }) + }).then(|_| { future::ok(()) }) } pub fn get_next_scan_nodes(&self) -> Vec {