aboutsummaryrefslogtreecommitdiff
path: root/src/dht/gnunet-service-xdht_neighbours.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dht/gnunet-service-xdht_neighbours.c')
-rw-r--r--src/dht/gnunet-service-xdht_neighbours.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/dht/gnunet-service-xdht_neighbours.c b/src/dht/gnunet-service-xdht_neighbours.c
index 167ba5577..472007215 100644
--- a/src/dht/gnunet-service-xdht_neighbours.c
+++ b/src/dht/gnunet-service-xdht_neighbours.c
@@ -957,6 +957,10 @@ unsigned int act_malicious;
957 */ 957 */
958static unsigned int total_fingers_found; 958static unsigned int total_fingers_found;
959 959
960/**
961 * Number of times we found the same successor.
962 */
963static unsigned int successor_times;
960 964
961/** 965/**
962 * Called when core is ready to send a message we asked for 966 * Called when core is ready to send a message we asked for
@@ -5058,6 +5062,16 @@ compare_and_update_successor (struct GNUNET_PeerIdentity curr_succ,
5058 GNUNET_STATISTICS_set (GDS_stats, key, succ, 0); 5062 GNUNET_STATISTICS_set (GDS_stats, key, succ, 0);
5059 GNUNET_free (key); 5063 GNUNET_free (key);
5060 } 5064 }
5065
5066 if(0 == successor_times)
5067 {
5068 verify_successor_next_send_time =
5069 GNUNET_TIME_STD_BACKOFF (verify_successor_next_send_time);
5070 }
5071 if (0 != successor_times)
5072 successor_times--;
5073
5074
5061 if (send_verify_successor_task == GNUNET_SCHEDULER_NO_TASK) 5075 if (send_verify_successor_task == GNUNET_SCHEDULER_NO_TASK)
5062 send_verify_successor_task = 5076 send_verify_successor_task =
5063 GNUNET_SCHEDULER_add_delayed(verify_successor_next_send_time, 5077 GNUNET_SCHEDULER_add_delayed(verify_successor_next_send_time,
@@ -6059,7 +6073,7 @@ GDS_NEIGHBOURS_init (void)
6059 //TODO: check size of this peer map? 6073 //TODO: check size of this peer map?
6060 friend_peermap = GNUNET_CONTAINER_multipeermap_create (256, GNUNET_NO); 6074 friend_peermap = GNUNET_CONTAINER_multipeermap_create (256, GNUNET_NO);
6061 finger_table_init (); 6075 finger_table_init ();
6062 6076 successor_times = 10;
6063 find_finger_trail_task_next_send_time.rel_value_us = 6077 find_finger_trail_task_next_send_time.rel_value_us =
6064 DHT_FIND_FINGER_TRAIL_INTERVAL.rel_value_us + 6078 DHT_FIND_FINGER_TRAIL_INTERVAL.rel_value_us +
6065 GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, 6079 GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK,