- Fix comparison direction
authorBart Polot <bart@net.in.tum.de>
Thu, 8 Mar 2012 19:24:42 +0000 (19:24 +0000)
committerBart Polot <bart@net.in.tum.de>
Thu, 8 Mar 2012 19:24:42 +0000 (19:24 +0000)
src/nse/gnunet-service-nse.c

index bf78e23718ed609f5c785d7f432331078e542c9d..12763583c52a78924de8f03b1221e4ab429f1def 100644 (file)
@@ -762,15 +762,15 @@ update_flood_message (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
         GNUNET_SCHEDULER_add_delayed (offset, &update_flood_message, NULL);
     return;
   }
-  current_timestamp = next_timestamp;
-  next_timestamp =
-      GNUNET_TIME_absolute_add (current_timestamp, gnunet_nse_interval);
   estimate_index = (estimate_index + 1) % HISTORY_SIZE;
   if (estimate_count < HISTORY_SIZE)
     estimate_count++;
+  current_timestamp = next_timestamp;
+  next_timestamp =
+      GNUNET_TIME_absolute_add (current_timestamp, gnunet_nse_interval);
   if ((current_timestamp.abs_value ==
       GNUNET_TIME_absolute_ntoh (next_message.timestamp).abs_value) &&
-      (get_matching_bits (current_timestamp, &my_identity) >
+      (get_matching_bits (current_timestamp, &my_identity) <
       ntohl(next_message.matching_bits)))
   {
     /* we received a message for this round way early, use it! */