diff options
author | Florian Dold <florian.dold@gmail.com> | 2013-08-13 11:14:52 +0000 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2013-08-13 11:14:52 +0000 |
commit | 700adc7f3dd9aa84f52517e091d27a271f3f7e07 (patch) | |
tree | 8541e8bd448d91065131b913d37e2025fbd88584 /src/consensus | |
parent | 1d39a4da8d582754858266cac8ce1066efd37879 (diff) | |
download | gnunet-700adc7f3dd9aa84f52517e091d27a271f3f7e07.tar.gz gnunet-700adc7f3dd9aa84f52517e091d27a271f3f7e07.zip |
- disable nse in the profiler config
- handle ghost peers correctly in exchange round
Diffstat (limited to 'src/consensus')
-rw-r--r-- | src/consensus/gnunet-service-consensus.c | 17 | ||||
-rw-r--r-- | src/consensus/test_consensus.conf | 3 |
2 files changed, 15 insertions, 5 deletions
diff --git a/src/consensus/gnunet-service-consensus.c b/src/consensus/gnunet-service-consensus.c index e9d7f05ea..94d532c3d 100644 --- a/src/consensus/gnunet-service-consensus.c +++ b/src/consensus/gnunet-service-consensus.c | |||
@@ -493,6 +493,9 @@ find_partners (struct ConsensusSession *session) | |||
493 | while (largest_arc < session->num_peers) | 493 | while (largest_arc < session->num_peers) |
494 | largest_arc <<= 1; | 494 | largest_arc <<= 1; |
495 | num_ghosts = largest_arc - session->num_peers; | 495 | num_ghosts = largest_arc - session->num_peers; |
496 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "largest arc: %u\n", largest_arc); | ||
497 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "arc: %u\n", arc); | ||
498 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "num ghosts: %u\n", num_ghosts); | ||
496 | 499 | ||
497 | if (0 == (my_idx & arc)) | 500 | if (0 == (my_idx & arc)) |
498 | { | 501 | { |
@@ -509,18 +512,22 @@ find_partners (struct ConsensusSession *session) | |||
509 | int ghost_partner_idx; | 512 | int ghost_partner_idx; |
510 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "my index %d, arc %d, peers %u\n", my_idx, arc, session->num_peers); | 513 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "my index %d, arc %d, peers %u\n", my_idx, arc, session->num_peers); |
511 | ghost_partner_idx = (my_idx - (int) arc) % (int) session->num_peers; | 514 | ghost_partner_idx = (my_idx - (int) arc) % (int) session->num_peers; |
512 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ghost partner is before %d\n", ghost_partner_idx); | ||
513 | /* platform dependent; modulo sometimes returns negative values */ | 515 | /* platform dependent; modulo sometimes returns negative values */ |
514 | if (ghost_partner_idx < 0) | 516 | if (ghost_partner_idx < 0) |
515 | ghost_partner_idx += session->num_peers; | 517 | ghost_partner_idx += session->num_peers; |
516 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ghost partner is after %d\n", ghost_partner_idx); | 518 | /* we only need to have a ghost partner if the partner is outgoing */ |
517 | session->partner_incoming = &session->info[session->shuffle[ghost_partner_idx]]; | 519 | if (0 == (ghost_partner_idx & arc)) |
518 | session->partner_incoming->exp_subround_finished = GNUNET_NO; | 520 | { |
519 | return; | 521 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ghost partner is %d\n", ghost_partner_idx); |
522 | session->partner_incoming = &session->info[session->shuffle[ghost_partner_idx]]; | ||
523 | session->partner_incoming->exp_subround_finished = GNUNET_NO; | ||
524 | return; | ||
525 | } | ||
520 | } | 526 | } |
521 | session->partner_incoming = NULL; | 527 | session->partner_incoming = NULL; |
522 | return; | 528 | return; |
523 | } | 529 | } |
530 | /* we only have an incoming connection */ | ||
524 | partner_idx = (my_idx - (int) arc) % (int) session->num_peers; | 531 | partner_idx = (my_idx - (int) arc) % (int) session->num_peers; |
525 | if (partner_idx < 0) | 532 | if (partner_idx < 0) |
526 | partner_idx += session->num_peers; | 533 | partner_idx += session->num_peers; |
diff --git a/src/consensus/test_consensus.conf b/src/consensus/test_consensus.conf index a11564a01..bcfdaba0f 100644 --- a/src/consensus/test_consensus.conf +++ b/src/consensus/test_consensus.conf | |||
@@ -43,3 +43,6 @@ DISABLEV6 = NO | |||
43 | # Do we use addresses from localhost address ranges? (::1, 127.0.0.0/8) | 43 | # Do we use addresses from localhost address ranges? (::1, 127.0.0.0/8) |
44 | RETURN_LOCAL_ADDRESSES = YES | 44 | RETURN_LOCAL_ADDRESSES = YES |
45 | 45 | ||
46 | [nse] | ||
47 | AUTOSTART = NO | ||
48 | |||