{
val = htonl (size_estimate_messages[(estimate_index - i + HISTORY_SIZE)
% HISTORY_SIZE].matching_bits);
- weight = estimate_count + 1 - i;
+ weight = 1; /* was: estimate_count + 1 - i; */
temp = weight + sumweight;
q = val - mean;
em->header.type
= htons (GNUNET_MESSAGE_TYPE_NSE_ESTIMATE);
em->reserved = htonl (0);
+ em->timestamp = GNUNET_TIME_absolute_hton(GNUNET_TIME_absolute_get());
em->size_estimate = mean - 1.0/3.0;
em->std_deviation = std_dev;
GNUNET_STATISTICS_set (stats,
}
if (matching_bits <= ntohl (size_estimate_messages[idx].matching_bits))
{
+ if ( (idx < estimate_index) &&
+ (peer_entry->previous_round == GNUNET_YES) )
+ peer_entry->previous_round = GNUNET_NO;
+ /* push back our result now, that peer is spreading bad information... */
+ if (peer_entry->transmit_task != GNUNET_SCHEDULER_NO_TASK)
+ GNUNET_SCHEDULER_cancel (peer_entry->transmit_task);
+ peer_entry->transmit_task = GNUNET_SCHEDULER_add_now (&transmit_task,
+ peer_entry);
/* Not closer than our most recent message, no need to do work here */
GNUNET_STATISTICS_update (stats,
"# flood messages ignored (had closer already)",