From 5879deb3c2412ede68b6b1d1aad98a7e359a153a Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 28 Feb 2017 16:07:46 +0100 Subject: [PATCH] set: adjust strata estimator bias --- src/set/gnunet-service-set_union.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/set/gnunet-service-set_union.c b/src/set/gnunet-service-set_union.c index 90f52ff47..f46713c31 100644 --- a/src/set/gnunet-service-set_union.c +++ b/src/set/gnunet-service-set_union.c @@ -873,6 +873,10 @@ handle_p2p_strata_estimator (void *cls, GNUNET_assert (NULL != op->state->se); diff = strata_estimator_difference (remote_se, op->state->se); + + if (diff > 200) + diff = diff * 3 / 2; + strata_estimator_destroy (remote_se); strata_estimator_destroy (op->state->se); op->state->se = NULL; @@ -1565,7 +1569,7 @@ handle_p2p_full_element (void *cls, } if ( (GNUNET_YES == op->spec->byzantine) && - (op->state->received_total > 128 + op->state->received_fresh * 4) && + (op->state->received_total > 384 + op->state->received_fresh * 4) && (op->state->received_fresh < op->state->received_total / 6) ) { /* The other peer gave us lots of old elements, there's something wrong. */ -- 2.25.1