aboutsummaryrefslogtreecommitdiff
path: root/src/consensus
diff options
context:
space:
mode:
Diffstat (limited to 'src/consensus')
-rw-r--r--src/consensus/consensus_api.c2
-rw-r--r--src/consensus/gnunet-service-consensus.c27
-rw-r--r--src/consensus/plugin_block_consensus.c1
-rw-r--r--src/consensus/test_consensus_api.c2
4 files changed, 19 insertions, 13 deletions
diff --git a/src/consensus/consensus_api.c b/src/consensus/consensus_api.c
index c4350adaf..06b4c88ef 100644
--- a/src/consensus/consensus_api.c
+++ b/src/consensus/consensus_api.c
@@ -259,6 +259,7 @@ idc_adapter (void *cls)
259 GNUNET_free (i); 259 GNUNET_free (i);
260} 260}
261 261
262
262/** 263/**
263 * Insert an element in the set being reconsiled. Must not be called after 264 * Insert an element in the set being reconsiled. Must not be called after
264 * "GNUNET_CONSENSUS_conclude". 265 * "GNUNET_CONSENSUS_conclude".
@@ -344,4 +345,5 @@ GNUNET_CONSENSUS_destroy (struct GNUNET_CONSENSUS_Handle *consensus)
344 GNUNET_free (consensus); 345 GNUNET_free (consensus);
345} 346}
346 347
348
347/* end of consensus_api.c */ 349/* end of consensus_api.c */
diff --git a/src/consensus/gnunet-service-consensus.c b/src/consensus/gnunet-service-consensus.c
index 8ef70eee8..160d352d7 100644
--- a/src/consensus/gnunet-service-consensus.c
+++ b/src/consensus/gnunet-service-consensus.c
@@ -100,7 +100,6 @@ struct TaskKey
100}; 100};
101 101
102 102
103
104struct SetKey 103struct SetKey
105{ 104{
106 int set_kind GNUNET_PACKED; 105 int set_kind GNUNET_PACKED;
@@ -403,7 +402,6 @@ struct SetHandle
403}; 402};
404 403
405 404
406
407/** 405/**
408 * A consensus session consists of one local client and the remote authorities. 406 * A consensus session consists of one local client and the remote authorities.
409 */ 407 */
@@ -590,6 +588,7 @@ setname (uint16_t kind)
590 } 588 }
591} 589}
592 590
591
593static const char * 592static const char *
594rfnname (uint16_t kind) 593rfnname (uint16_t kind)
595{ 594{
@@ -605,6 +604,7 @@ rfnname (uint16_t kind)
605 } 604 }
606} 605}
607 606
607
608static const char * 608static const char *
609diffname (uint16_t kind) 609diffname (uint16_t kind)
610{ 610{
@@ -622,6 +622,7 @@ diffname (uint16_t kind)
622 } 622 }
623} 623}
624 624
625
625#ifdef GNUNET_EXTRA_LOGGING 626#ifdef GNUNET_EXTRA_LOGGING
626 627
627 628
@@ -635,6 +636,7 @@ debug_str_element (const struct GNUNET_SET_Element *el)
635 return GNUNET_h2s (&hash); 636 return GNUNET_h2s (&hash);
636} 637}
637 638
639
638static const char * 640static const char *
639debug_str_task_key (struct TaskKey *tk) 641debug_str_task_key (struct TaskKey *tk)
640{ 642{
@@ -648,6 +650,7 @@ debug_str_task_key (struct TaskKey *tk)
648 return buf; 650 return buf;
649} 651}
650 652
653
651static const char * 654static const char *
652debug_str_diff_key (struct DiffKey *dk) 655debug_str_diff_key (struct DiffKey *dk)
653{ 656{
@@ -660,6 +663,7 @@ debug_str_diff_key (struct DiffKey *dk)
660 return buf; 663 return buf;
661} 664}
662 665
666
663static const char * 667static const char *
664debug_str_set_key (const struct SetKey *sk) 668debug_str_set_key (const struct SetKey *sk)
665{ 669{
@@ -685,6 +689,7 @@ debug_str_rfn_key (const struct RfnKey *rk)
685 return buf; 689 return buf;
686} 690}
687 691
692
688#endif /* GNUNET_EXTRA_LOGGING */ 693#endif /* GNUNET_EXTRA_LOGGING */
689 694
690 695
@@ -1192,6 +1197,7 @@ set_result_cb (void *cls,
1192 } 1197 }
1193} 1198}
1194 1199
1200
1195#ifdef EVIL 1201#ifdef EVIL
1196 1202
1197enum EvilnessType 1203enum EvilnessType
@@ -1349,6 +1355,7 @@ cleanup:
1349 free (evil_subtype_str); 1355 free (evil_subtype_str);
1350} 1356}
1351 1357
1358
1352#endif 1359#endif
1353 1360
1354 1361
@@ -1538,6 +1545,7 @@ put_diff (struct ConsensusSession *session,
1538 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); 1545 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
1539} 1546}
1540 1547
1548
1541static void 1549static void
1542put_set (struct ConsensusSession *session, 1550put_set (struct ConsensusSession *session,
1543 struct SetEntry *set) 1551 struct SetEntry *set)
@@ -1570,7 +1578,6 @@ put_rfn (struct ConsensusSession *session,
1570} 1578}
1571 1579
1572 1580
1573
1574static void 1581static void
1575task_cancel_reconcile (struct TaskEntry *task) 1582task_cancel_reconcile (struct TaskEntry *task)
1576{ 1583{
@@ -1676,6 +1683,8 @@ diff_destroy (struct DiffEntry *diff)
1676 GNUNET_CONTAINER_multihashmap_destroy (diff->changes); 1683 GNUNET_CONTAINER_multihashmap_destroy (diff->changes);
1677 GNUNET_free (diff); 1684 GNUNET_free (diff);
1678} 1685}
1686
1687
1679#endif 1688#endif
1680 1689
1681 1690
@@ -1882,7 +1891,6 @@ finish_step (struct Step *step)
1882} 1891}
1883 1892
1884 1893
1885
1886/** 1894/**
1887 * Apply the result from one round of gradecasts (i.e. every peer 1895 * Apply the result from one round of gradecasts (i.e. every peer
1888 * should have gradecasted) to the peer's current set. 1896 * should have gradecasted) to the peer's current set.
@@ -2326,8 +2334,7 @@ task_start_eval_echo (struct TaskEntry *task)
2326 can't simply send "nothing" for the value. Thus we mark our 'confirm' 2334 can't simply send "nothing" for the value. Thus we mark our 'confirm'
2327 reconciliation as contested. Other peers might not know that the 2335 reconciliation as contested. Other peers might not know that the
2328 leader is faulty, thus we still re-distribute in the confirmation 2336 leader is faulty, thus we still re-distribute in the confirmation
2329 round. */ 2337 round. */output_set->is_contested = GNUNET_YES;
2330 output_set->is_contested = GNUNET_YES;
2331 } 2338 }
2332 2339
2333 switch (majority_vote) 2340 switch (majority_vote)
@@ -2387,6 +2394,7 @@ task_start_finish (struct TaskEntry *task)
2387 task); 2394 task);
2388} 2395}
2389 2396
2397
2390static void 2398static void
2391start_task (struct ConsensusSession *session, struct TaskEntry *task) 2399start_task (struct ConsensusSession *session, struct TaskEntry *task)
2392{ 2400{
@@ -2403,8 +2411,6 @@ start_task (struct ConsensusSession *session, struct TaskEntry *task)
2403} 2411}
2404 2412
2405 2413
2406
2407
2408/* 2414/*
2409 * Run all steps of the session that don't any 2415 * Run all steps of the session that don't any
2410 * more dependencies. 2416 * more dependencies.
@@ -2452,7 +2458,6 @@ run_ready_steps (struct ConsensusSession *session)
2452} 2458}
2453 2459
2454 2460
2455
2456static void 2461static void
2457finish_task (struct TaskEntry *task) 2462finish_task (struct TaskEntry *task)
2458{ 2463{
@@ -2703,7 +2708,6 @@ set_listen_cb (void *cls,
2703} 2708}
2704 2709
2705 2710
2706
2707static void 2711static void
2708put_task (struct GNUNET_CONTAINER_MultiHashMap *taskmap, 2712put_task (struct GNUNET_CONTAINER_MultiHashMap *taskmap,
2709 struct TaskEntry *t) 2713 struct TaskEntry *t)
@@ -2754,7 +2758,6 @@ install_step_timeouts (struct ConsensusSession *session)
2754} 2758}
2755 2759
2756 2760
2757
2758/* 2761/*
2759 * Arrange two peers in some canonical order. 2762 * Arrange two peers in some canonical order.
2760 */ 2763 */
@@ -3134,7 +3137,6 @@ construct_task_graph (struct ConsensusSession *session)
3134 step = NULL; 3137 step = NULL;
3135 3138
3136 3139
3137
3138 /* Byzantine union */ 3140 /* Byzantine union */
3139 3141
3140 /* sequential repetitions of the gradecasts */ 3142 /* sequential repetitions of the gradecasts */
@@ -3193,7 +3195,6 @@ construct_task_graph (struct ConsensusSession *session)
3193} 3195}
3194 3196
3195 3197
3196
3197/** 3198/**
3198 * Check join message. 3199 * Check join message.
3199 * 3200 *
diff --git a/src/consensus/plugin_block_consensus.c b/src/consensus/plugin_block_consensus.c
index 1caf4fc39..fb6da5bcd 100644
--- a/src/consensus/plugin_block_consensus.c
+++ b/src/consensus/plugin_block_consensus.c
@@ -134,4 +134,5 @@ libgnunet_plugin_block_consensus_done (void *cls)
134 return NULL; 134 return NULL;
135} 135}
136 136
137
137/* end of plugin_block_consensus.c */ 138/* end of plugin_block_consensus.c */
diff --git a/src/consensus/test_consensus_api.c b/src/consensus/test_consensus_api.c
index d32bc06ed..235a67484 100644
--- a/src/consensus/test_consensus_api.c
+++ b/src/consensus/test_consensus_api.c
@@ -44,6 +44,7 @@ conclude_done (void *cls)
44 GNUNET_SCHEDULER_shutdown (); 44 GNUNET_SCHEDULER_shutdown ();
45} 45}
46 46
47
47static void 48static void
48on_new_element (void *cls, 49on_new_element (void *cls,
49 const struct GNUNET_SET_Element *element) 50 const struct GNUNET_SET_Element *element)
@@ -51,6 +52,7 @@ on_new_element (void *cls,
51 elements_received++; 52 elements_received++;
52} 53}
53 54
55
54static void 56static void
55insert_done (void *cls, int success) 57insert_done (void *cls, int success)
56{ 58{