gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r13355 - gnunet/src/dht


From: gnunet
Subject: [GNUnet-SVN] r13355 - gnunet/src/dht
Date: Thu, 21 Oct 2010 17:26:47 +0200

Author: nevans
Date: 2010-10-21 17:26:47 +0200 (Thu, 21 Oct 2010)
New Revision: 13355

Modified:
   gnunet/src/dht/gnunet-service-dht.c
Log:
oops

Modified: gnunet/src/dht/gnunet-service-dht.c
===================================================================
--- gnunet/src/dht/gnunet-service-dht.c 2010-10-21 15:21:29 UTC (rev 13354)
+++ gnunet/src/dht/gnunet-service-dht.c 2010-10-21 15:26:47 UTC (rev 13355)
@@ -2887,6 +2887,7 @@
   unsigned long long ret;
   unsigned int other_matching_bits;
   double base_converge_modifier = .1;
+  double temp_modifier;
   double calc_value;
   double exponent;
   int curr_max_hops;
@@ -2897,14 +2898,14 @@
     curr_max_hops = (estimate_diameter() + 1) * 2;
 
   if (converge_modifier > 0)
-    converge_modifier = converge_modifier * base_converge_modifier;
+    temp_modifier = converge_modifier * base_converge_modifier;
   else
     {
-      converge_modifier = base_converge_modifier;
+      temp_modifier = base_converge_modifier;
       base_converge_modifier = 0.0;
     }
 
-  GNUNET_assert(converge_modifier > 0);
+  GNUNET_assert(temp_modifier > 0);
 
   other_matching_bits = GNUNET_CRYPTO_hash_matching_bits(target, 
&peer->id.hashPubKey);
 
@@ -2913,20 +2914,20 @@
       case DHT_CONVERGE_RANDOM:
         return 1; /* Always return 1, choose equally among all peers */
       case DHT_CONVERGE_LINEAR:
-        calc_value = hops * curr_max_hops * converge_modifier;
+        calc_value = hops * curr_max_hops * temp_modifier;
         break;
       case DHT_CONVERGE_SQUARE:
         /**
          * Simple square based curve.
          */
-        calc_value = (sqrt(hops) / sqrt(curr_max_hops)) * (curr_max_hops / 
(curr_max_hops * converge_modifier));
+        calc_value = (sqrt(hops) / sqrt(curr_max_hops)) * (curr_max_hops / 
(curr_max_hops * temp_modifier));
         break;
       case DHT_CONVERGE_EXPONENTIAL:
         /**
          * Simple exponential curve.
          */
         if (base_converge_modifier > 0)
-          calc_value = (converge_modifier * hops * hops) / curr_max_hops;
+          calc_value = (temp_modifier * hops * hops) / curr_max_hops;
         else
           calc_value = (hops * hops) / curr_max_hops;
         break;
@@ -3230,7 +3231,7 @@
   /* Now actually choose a peer */
   selected = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, 
total_distance);
 
-  /* Put the sorted closest peers into the possible bins first, in case of 
overflow. */
+  /* Go over closest sorted peers. */
   for (i = 0; i < offset; i++)
     {
       if (GNUNET_YES == GNUNET_CONTAINER_bloomfilter_test (bloom, 
&sorted_closest[i]->id.hashPubKey))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]