if ((GNUNET_YES == is_in_view (i, peer_idx)) &&
(1 <= (0.45 * view_size)))
{
- prob_push = 1.0 * binom (0.45 * view_size, 1)
- /
- binom (view_size, 0.45 * view_size);
+ if (0 == binom (view_size, 0.45 * view_size)) prob_push = 0;
+ else
+ {
+ prob_push = 1.0 * binom (0.45 * view_size, 1)
+ /
+ binom (view_size, 0.45 * view_size);
+ }
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"\t\t%" PRIu32 " is in %" PRIu32 "'s view, prob: %f\n",
peer_idx,
rps_peer->index);
GNUNET_free (stat_cls);
GNUNET_break (0);
+ return;
}
if (NULL != rps_peer->stat_op &&
struct OpListEntry *entry;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "RUN was called\n");
- printf ("test 1\n");
/* Check whether we timed out */
if (n_peers != num_peers ||
*
* @param argc unused
* @param argv unused
- * @return 0 on success
*/
static void
run (void *cls,
with the malicious portion */
ok = 1;
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "before _run()\n");
GNUNET_TESTBED_run (NULL,
cfg,
num_peers,
NULL,
&test_run,
NULL);
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "after _run()\n");
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "gnunet-rps-profiler returned.\n");
}
/**
return;
}
+ if (GNUNET_YES != GNUNET_DISK_file_close (f))
+ LOG (GNUNET_ERROR_TYPE_WARNING,
+ "Unable to close file\n");
}
void
const char *prefix)
{
unsigned int len_file_name;
- unsigned int out_size;
+ int out_size;
char *file_name;
const char *pid_long;