aboutsummaryrefslogtreecommitdiff
path: root/src/dht/gnunet-service-dht_nse.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dht/gnunet-service-dht_nse.c')
-rw-r--r--src/dht/gnunet-service-dht_nse.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/dht/gnunet-service-dht_nse.c b/src/dht/gnunet-service-dht_nse.c
index 7f411cf71..58f18816a 100644
--- a/src/dht/gnunet-service-dht_nse.c
+++ b/src/dht/gnunet-service-dht_nse.c
@@ -52,11 +52,13 @@ static struct GNUNET_NSE_Handle *nse;
52 * 52 *
53 */ 53 */
54static void 54static void
55update_network_size_estimate (void *cls, struct GNUNET_TIME_Absolute timestamp, 55update_network_size_estimate (void *cls,
56 double logestimate, double std_dev) 56 struct GNUNET_TIME_Absolute timestamp,
57 double logestimate,
58 double std_dev)
57{ 59{
58 GNUNET_STATISTICS_update (GDS_stats, 60 GNUNET_STATISTICS_update (GDS_stats,
59 gettext_noop ("# Network size estimates received"), 61 "# Network size estimates received",
60 1, GNUNET_NO); 62 1, GNUNET_NO);
61 /* do not allow estimates < 0.5 */ 63 /* do not allow estimates < 0.5 */
62 log_of_network_size_estimate = GNUNET_MAX (0.5, logestimate); 64 log_of_network_size_estimate = GNUNET_MAX (0.5, logestimate);
@@ -83,20 +85,22 @@ GDS_NSE_init ()
83{ 85{
84 unsigned long long hops; 86 unsigned long long hops;
85 87
86 if ((GNUNET_YES == 88 if ( (GNUNET_YES ==
87 GNUNET_CONFIGURATION_have_value (GDS_cfg, 89 GNUNET_CONFIGURATION_have_value (GDS_cfg,
88 "dht", 90 "dht",
89 "FORCE_NSE")) && 91 "FORCE_NSE")) &&
90 (GNUNET_OK == 92 (GNUNET_OK ==
91 GNUNET_CONFIGURATION_get_value_number (GDS_cfg, 93 GNUNET_CONFIGURATION_get_value_number (GDS_cfg,
92 "dht", 94 "dht",
93 "FORCE_NSE", 95 "FORCE_NSE",
94 &hops))) 96 &hops)) )
95 { 97 {
96 log_of_network_size_estimate = (double) hops; 98 log_of_network_size_estimate = (double) hops;
97 return; 99 return;
98 } 100 }
99 nse = GNUNET_NSE_connect (GDS_cfg, &update_network_size_estimate, NULL); 101 nse = GNUNET_NSE_connect (GDS_cfg,
102 &update_network_size_estimate,
103 NULL);
100} 104}
101 105
102 106