- /**
- * Initialization for validation throttling
- *
- * We have a maximum number max_fds of connections we can use for validation
- * We monitor the number of validations in parallel and start to throttle it
- * when doing to many validations in parallel:
- * if (running validations < (max_fds / 2))
- * - "fast start": run validation immediately
- * - have delay of (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT.rel_value) / (max_fds / 2)
- * (300 sec / ~150 == ~2 sec.) between two validations
- */
-
- validation_next = GNUNET_TIME_absolute_get();
- validation_delay.rel_value = (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT.rel_value) / (max_fds / 2);
- validations_fast_start_threshold = (max_fds / 2);
- validations_running = 0;
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Validation uses a fast start threshold of %u connections and a delay between of %u ms\n ",
- validations_fast_start_threshold, validation_delay.rel_value);
- validation_map = GNUNET_CONTAINER_multihashmap_create (VALIDATION_MAP_SIZE,
+ /**
+ * Initialization for validation throttling
+ *
+ * We have a maximum number max_fds of connections we can use for validation
+ * We monitor the number of validations in parallel and start to throttle it
+ * when doing to many validations in parallel:
+ * if (running validations < (max_fds / 2))
+ * - "fast start": run validation immediately
+ * - have delay of (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT.rel_value_us) / (max_fds / 2)
+ * (300 sec / ~150 == ~2 sec.) between two validations
+ */
+
+ validation_next = GNUNET_TIME_absolute_get();
+ validation_delay.rel_value_us = (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT.rel_value_us) / (max_fds / 2);
+ validations_fast_start_threshold = (max_fds / 2);
+ validations_running = 0;
+ GNUNET_STATISTICS_set (GST_stats,
+ gettext_noop ("# validations running"),
+ validations_running,
+ GNUNET_NO);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Validation uses a fast start threshold of %u connections and a delay of %s\n",
+ validations_fast_start_threshold,
+ GNUNET_STRINGS_relative_time_to_string (validation_delay,
+ GNUNET_YES));
+ validation_map = GNUNET_CONTAINER_multipeermap_create (VALIDATION_MAP_SIZE,