diff options
Diffstat (limited to 'src/consensus/plugin_block_consensus.c')
-rw-r--r-- | src/consensus/plugin_block_consensus.c | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/src/consensus/plugin_block_consensus.c b/src/consensus/plugin_block_consensus.c index ca19b7c8d..a90b451d2 100644 --- a/src/consensus/plugin_block_consensus.c +++ b/src/consensus/plugin_block_consensus.c | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file consensus/plugin_block_consensus.c | 22 | * @file consensus/plugin_block_consensus.c |
@@ -47,35 +47,35 @@ | |||
47 | * @return characterization of result | 47 | * @return characterization of result |
48 | */ | 48 | */ |
49 | static enum GNUNET_BLOCK_EvaluationResult | 49 | static enum GNUNET_BLOCK_EvaluationResult |
50 | block_plugin_consensus_evaluate (void *cls, | 50 | block_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; |
63 | 63 | ||
64 | const struct ConsensusElement *ce = reply_block; | 64 | const struct ConsensusElement *ce = reply_block; |
65 | 65 | ||
66 | if ( (0 != ce->marker) || | 66 | if ((0 != ce->marker) || |
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 ConsensusElement)); |
79 | } | 79 | } |
80 | 80 | ||
81 | 81 | ||
@@ -91,11 +91,11 @@ block_plugin_consensus_evaluate (void *cls, | |||
91 | * (or if extracting a key from a block of this type does not work) | 91 | * (or if extracting a key from a block of this type does not work) |
92 | */ | 92 | */ |
93 | static int | 93 | static int |
94 | block_plugin_consensus_get_key (void *cls, | 94 | block_plugin_consensus_get_key(void *cls, |
95 | enum GNUNET_BLOCK_Type type, | 95 | enum GNUNET_BLOCK_Type type, |
96 | const void *block, | 96 | const void *block, |
97 | size_t block_size, | 97 | size_t block_size, |
98 | struct GNUNET_HashCode *key) | 98 | struct GNUNET_HashCode *key) |
99 | { | 99 | { |
100 | return GNUNET_SYSERR; | 100 | return GNUNET_SYSERR; |
101 | } | 101 | } |
@@ -105,7 +105,7 @@ block_plugin_consensus_get_key (void *cls, | |||
105 | * Entry point for the plugin. | 105 | * Entry point for the plugin. |
106 | */ | 106 | */ |
107 | void * | 107 | void * |
108 | libgnunet_plugin_block_consensus_init (void *cls) | 108 | libgnunet_plugin_block_consensus_init(void *cls) |
109 | { | 109 | { |
110 | static enum GNUNET_BLOCK_Type types[] = | 110 | static enum GNUNET_BLOCK_Type types[] = |
111 | { | 111 | { |
@@ -114,7 +114,7 @@ libgnunet_plugin_block_consensus_init (void *cls) | |||
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 | */ |
128 | void * | 128 | void * |
129 | libgnunet_plugin_block_consensus_done (void *cls) | 129 | libgnunet_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 | ||