Просмотр исходного кода

Use analysis branch of Troll Patrol

Vecna 4 месяцев назад
Родитель
Сommit
84d431e21a
2 измененных файлов с 12 добавлено и 3 удалено
  1. 2 1
      Dockerfile
  2. 10 2
      src/censor.rs

+ 2 - 1
Dockerfile

@@ -53,7 +53,8 @@ RUN cp /home/user/build/config.toml .cargo/
 WORKDIR /home/user/build
 RUN git clone https://git-crysp.uwaterloo.ca/vvecna/troll-patrol.git
 WORKDIR /home/user/build/troll-patrol
-RUN git checkout dc7531689c2a5ec5b4c757f95a87f576c4d4020c
+# Commit on analysis branch
+RUN git checkout 264e3824d68d3c548de302e4cc576faa3d99f8da
 RUN mkdir -p .cargo
 RUN cp /home/user/build/config.toml .cargo/
 

+ 10 - 2
src/censor.rs

@@ -169,10 +169,18 @@ impl Censor {
                     if self.has_lox_cred(fingerprint) {
                         let (_cred, cred_count) =
                             &self.lox_credentials.get(&bridge.fingerprint).unwrap();
+
+                        // Reduce the number of these for efficiency. It
+                        // does not benefit the censor to submit more
+                        // than 25 positive reports under the current
+                        // detection algorithm. In practice, the censor
+                        // should submit as many reports as possible.
                         let num_prs = if config.one_positive_report_per_cred {
-                            *cred_count
+                            // *cred_count
+                            min(*cred_count, 25)
                         } else {
-                            30000
+                            //30000
+                            25
                         };
                         for _ in 0..num_prs {
                             self.send_positive_report(config, &bridge.fingerprint).await;