Преглед на файлове

If positive reports change anything, print a notice

Vecna преди 4 месеца
родител
ревизия
7acba0a6f0
променени са 1 файла, в които са добавени 20 реда и са изтрити 0 реда
  1. 20 0
      src/analysis.rs

+ 20 - 0
src/analysis.rs

@@ -8,6 +8,9 @@ use std::{
     collections::{BTreeMap, HashSet},
 };
 
+#[cfg(feature = "simulation")]
+use crate::get_date;
+
 /// Provides a function for predicting which countries block this bridge
 pub trait Analyzer {
     /// Evaluate open-entry bridge. Returns true if blocked, false otherwise.
@@ -159,6 +162,23 @@ pub fn blocked_in(
                     positive_reports_today,
                 ) {
                     blocked_in.insert(country.to_string());
+                } else {
+                    // Logging in simulation mode
+                    #[cfg(feature = "simulation")]
+                    if analyzer.stage_two(
+                        age,
+                        confidence,
+                        &bridge_ips,
+                        bridge_ips_today,
+                        &negative_reports,
+                        negative_reports_today,
+                    ) {
+                        println!(
+                            "{} detected not blocked due to positive reports on day {}",
+                            array_bytes::bytes2hex("", bridge_info.fingerprint),
+                            get_date()
+                        );
+                    }
                 }
             }
         }