aboutsummaryrefslogtreecommitdiff
path: root/src/consensus/gnunet-service-consensus.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/consensus/gnunet-service-consensus.c')
-rw-r--r--src/consensus/gnunet-service-consensus.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/consensus/gnunet-service-consensus.c b/src/consensus/gnunet-service-consensus.c
index 74f758034..914943f11 100644
--- a/src/consensus/gnunet-service-consensus.c
+++ b/src/consensus/gnunet-service-consensus.c
@@ -147,7 +147,7 @@ struct ConsensusSession
147 * Only valid once the current round is not CONSENSUS_ROUND_BEGIN. 147 * Only valid once the current round is not CONSENSUS_ROUND_BEGIN.
148 */ 148 */
149 struct GNUNET_TIME_Relative conclude_timeout; 149 struct GNUNET_TIME_Relative conclude_timeout;
150 150
151 /** 151 /**
152 * Timeout task identifier for the current round. 152 * Timeout task identifier for the current round.
153 */ 153 */
@@ -286,7 +286,7 @@ have_exp_subround_finished (const struct ConsensusSession *session)
286{ 286{
287 int not_finished; 287 int not_finished;
288 not_finished = 0; 288 not_finished = 0;
289 if ( (NULL != session->partner_outgoing) && 289 if ( (NULL != session->partner_outgoing) &&
290 (GNUNET_NO == session->partner_outgoing->exp_subround_finished) ) 290 (GNUNET_NO == session->partner_outgoing->exp_subround_finished) )
291 not_finished++; 291 not_finished++;
292 if ( (NULL != session->partner_incoming) && 292 if ( (NULL != session->partner_incoming) &&
@@ -300,7 +300,7 @@ have_exp_subround_finished (const struct ConsensusSession *session)
300 300
301/** 301/**
302 * Destroy a session, free all resources associated with it. 302 * Destroy a session, free all resources associated with it.
303 * 303 *
304 * @param session the session to destroy 304 * @param session the session to destroy
305 */ 305 */
306static void 306static void
@@ -404,7 +404,7 @@ send_to_client_iter (void *cls,
404 * @param tc task context, for when this task is invoked by the scheduler, 404 * @param tc task context, for when this task is invoked by the scheduler,
405 * NULL if invoked for another reason 405 * NULL if invoked for another reason
406 */ 406 */
407static void 407static void
408round_over (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 408round_over (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
409{ 409{
410 struct ConsensusSession *session; 410 struct ConsensusSession *session;
@@ -459,7 +459,7 @@ shuffle (struct ConsensusSession *session)
459 if (NULL == session->shuffle_inv) 459 if (NULL == session->shuffle_inv)
460 session->shuffle_inv = GNUNET_malloc (session->num_peers * sizeof (*session->shuffle_inv)); 460 session->shuffle_inv = GNUNET_malloc (session->num_peers * sizeof (*session->shuffle_inv));
461 461
462 GNUNET_CRYPTO_kdf (randomness, sizeof (randomness), 462 GNUNET_CRYPTO_kdf (randomness, sizeof (randomness),
463 &session->exp_round, sizeof (uint32_t), 463 &session->exp_round, sizeof (uint32_t),
464 &session->global_id, sizeof (struct GNUNET_HashCode), 464 &session->global_id, sizeof (struct GNUNET_HashCode),
465 NULL); 465 NULL);
@@ -559,7 +559,7 @@ find_partners (struct ConsensusSession *session)
559 * @param element a result element, only valid if status is GNUNET_SET_STATUS_OK 559 * @param element a result element, only valid if status is GNUNET_SET_STATUS_OK
560 * @param status see enum GNUNET_SET_Status 560 * @param status see enum GNUNET_SET_Status
561 */ 561 */
562static void 562static void
563set_result_cb (void *cls, 563set_result_cb (void *cls,
564 const struct GNUNET_SET_Element *element, 564 const struct GNUNET_SET_Element *element,
565 enum GNUNET_SET_Status status) 565 enum GNUNET_SET_Status status)
@@ -674,7 +674,7 @@ subround_over (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
674 GNUNET_SCHEDULER_cancel (session->round_timeout_tid); 674 GNUNET_SCHEDULER_cancel (session->round_timeout_tid);
675 session->round_timeout_tid = GNUNET_SCHEDULER_NO_TASK; 675 session->round_timeout_tid = GNUNET_SCHEDULER_NO_TASK;
676 } 676 }
677 677
678 if (session->exp_round >= NUM_EXP_ROUNDS) 678 if (session->exp_round >= NUM_EXP_ROUNDS)
679 { 679 {
680 round_over (session, NULL); 680 round_over (session, NULL);
@@ -700,7 +700,7 @@ subround_over (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
700 session->exp_subround = 0; 700 session->exp_subround = 0;
701 shuffle (session); 701 shuffle (session);
702 } 702 }
703 else 703 else
704 { 704 {
705 session->exp_subround++; 705 session->exp_subround++;
706 } 706 }
@@ -810,7 +810,7 @@ get_peer_idx (const struct GNUNET_PeerIdentity *peer, const struct ConsensusSess
810 * @param session_id local id of the consensus session 810 * @param session_id local id of the consensus session
811 */ 811 */
812static void 812static void
813compute_global_id (struct ConsensusSession *session, 813compute_global_id (struct ConsensusSession *session,
814 const struct GNUNET_HashCode *session_id) 814 const struct GNUNET_HashCode *session_id)
815{ 815{
816 int i; 816 int i;
@@ -865,7 +865,7 @@ initialize_session_peer_list (struct ConsensusSession *session,
865 865
866 /* peers in the join message, may or may not include the local peer */ 866 /* peers in the join message, may or may not include the local peer */
867 listed_peers = ntohl (join_msg->num_peers); 867 listed_peers = ntohl (join_msg->num_peers);
868 868
869 session->num_peers = listed_peers; 869 session->num_peers = listed_peers;
870 870
871 msg_peers = (struct GNUNET_PeerIdentity *) &join_msg[1]; 871 msg_peers = (struct GNUNET_PeerIdentity *) &join_msg[1];
@@ -1025,7 +1025,7 @@ initialize_session (struct ConsensusSession *session,
1025 other_session = sessions_head; 1025 other_session = sessions_head;
1026 while (NULL != other_session) 1026 while (NULL != other_session)
1027 { 1027 {
1028 if ((other_session != session) && 1028 if ((other_session != session) &&
1029 (0 == GNUNET_CRYPTO_hash_cmp (&session->global_id, &other_session->global_id))) 1029 (0 == GNUNET_CRYPTO_hash_cmp (&session->global_id, &other_session->global_id)))
1030 { 1030 {
1031 if (CONSENSUS_ROUND_FINISH != other_session->current_round) 1031 if (CONSENSUS_ROUND_FINISH != other_session->current_round)