aboutsummaryrefslogtreecommitdiff
path: root/src/consensus/plugin_block_consensus.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/consensus/plugin_block_consensus.c')
-rw-r--r--src/consensus/plugin_block_consensus.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/src/consensus/plugin_block_consensus.c b/src/consensus/plugin_block_consensus.c
index a90b451d2..1caf4fc39 100644
--- a/src/consensus/plugin_block_consensus.c
+++ b/src/consensus/plugin_block_consensus.c
@@ -47,16 +47,16 @@
47 * @return characterization of result 47 * @return characterization of result
48 */ 48 */
49static enum GNUNET_BLOCK_EvaluationResult 49static enum GNUNET_BLOCK_EvaluationResult
50block_plugin_consensus_evaluate(void *cls, 50block_plugin_consensus_evaluate (void *cls,
51 struct GNUNET_BLOCK_Context *ctx, 51 struct GNUNET_BLOCK_Context *ctx,
52 enum GNUNET_BLOCK_Type type, 52 enum GNUNET_BLOCK_Type type,
53 struct GNUNET_BLOCK_Group *group, 53 struct GNUNET_BLOCK_Group *group,
54 enum GNUNET_BLOCK_EvaluationOptions eo, 54 enum GNUNET_BLOCK_EvaluationOptions eo,
55 const struct GNUNET_HashCode *query, 55 const struct GNUNET_HashCode *query,
56 const void *xquery, 56 const void *xquery,
57 size_t xquery_size, 57 size_t xquery_size,
58 const void *reply_block, 58 const void *reply_block,
59 size_t reply_block_size) 59 size_t reply_block_size)
60{ 60{
61 if (reply_block_size < sizeof(struct ConsensusElement)) 61 if (reply_block_size < sizeof(struct ConsensusElement))
62 return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; 62 return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
@@ -67,15 +67,16 @@ block_plugin_consensus_evaluate(void *cls,
67 (0 == ce->payload_type)) 67 (0 == ce->payload_type))
68 return GNUNET_BLOCK_EVALUATION_OK_MORE; 68 return GNUNET_BLOCK_EVALUATION_OK_MORE;
69 69
70 return GNUNET_BLOCK_evaluate(ctx, 70 return GNUNET_BLOCK_evaluate (ctx,
71 type, 71 type,
72 group, 72 group,
73 eo, 73 eo,
74 query, 74 query,
75 xquery, 75 xquery,
76 xquery_size, 76 xquery_size,
77 &ce[1], 77 &ce[1],
78 reply_block_size - sizeof(struct ConsensusElement)); 78 reply_block_size - sizeof(struct
79 ConsensusElement));
79} 80}
80 81
81 82
@@ -91,11 +92,11 @@ block_plugin_consensus_evaluate(void *cls,
91 * (or if extracting a key from a block of this type does not work) 92 * (or if extracting a key from a block of this type does not work)
92 */ 93 */
93static int 94static int
94block_plugin_consensus_get_key(void *cls, 95block_plugin_consensus_get_key (void *cls,
95 enum GNUNET_BLOCK_Type type, 96 enum GNUNET_BLOCK_Type type,
96 const void *block, 97 const void *block,
97 size_t block_size, 98 size_t block_size,
98 struct GNUNET_HashCode *key) 99 struct GNUNET_HashCode *key)
99{ 100{
100 return GNUNET_SYSERR; 101 return GNUNET_SYSERR;
101} 102}
@@ -105,16 +106,15 @@ block_plugin_consensus_get_key(void *cls,
105 * Entry point for the plugin. 106 * Entry point for the plugin.
106 */ 107 */
107void * 108void *
108libgnunet_plugin_block_consensus_init(void *cls) 109libgnunet_plugin_block_consensus_init (void *cls)
109{ 110{
110 static enum GNUNET_BLOCK_Type types[] = 111 static enum GNUNET_BLOCK_Type types[] = {
111 {
112 GNUNET_BLOCK_TYPE_CONSENSUS_ELEMENT, 112 GNUNET_BLOCK_TYPE_CONSENSUS_ELEMENT,
113 GNUNET_BLOCK_TYPE_ANY /* end of list */ 113 GNUNET_BLOCK_TYPE_ANY /* end of list */
114 }; 114 };
115 struct GNUNET_BLOCK_PluginFunctions *api; 115 struct GNUNET_BLOCK_PluginFunctions *api;
116 116
117 api = GNUNET_new(struct GNUNET_BLOCK_PluginFunctions); 117 api = GNUNET_new (struct GNUNET_BLOCK_PluginFunctions);
118 api->evaluate = &block_plugin_consensus_evaluate; 118 api->evaluate = &block_plugin_consensus_evaluate;
119 api->get_key = &block_plugin_consensus_get_key; 119 api->get_key = &block_plugin_consensus_get_key;
120 api->types = types; 120 api->types = types;
@@ -126,11 +126,11 @@ libgnunet_plugin_block_consensus_init(void *cls)
126 * Exit point from the plugin. 126 * Exit point from the plugin.
127 */ 127 */
128void * 128void *
129libgnunet_plugin_block_consensus_done(void *cls) 129libgnunet_plugin_block_consensus_done (void *cls)
130{ 130{
131 struct GNUNET_BLOCK_PluginFunctions *api = cls; 131 struct GNUNET_BLOCK_PluginFunctions *api = cls;
132 132
133 GNUNET_free(api); 133 GNUNET_free (api);
134 return NULL; 134 return NULL;
135} 135}
136 136