diff options
Diffstat (limited to 'src/revocation/plugin_block_revocation.c')
-rw-r--r-- | src/revocation/plugin_block_revocation.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/revocation/plugin_block_revocation.c b/src/revocation/plugin_block_revocation.c index 7c1ec26eb..f384cfe1d 100644 --- a/src/revocation/plugin_block_revocation.c +++ b/src/revocation/plugin_block_revocation.c | |||
@@ -52,6 +52,7 @@ | |||
52 | struct InternalContext | 52 | struct InternalContext |
53 | { | 53 | { |
54 | unsigned int matching_bits; | 54 | unsigned int matching_bits; |
55 | struct GNUNET_TIME_Relative epoch_length; | ||
55 | }; | 56 | }; |
56 | 57 | ||
57 | 58 | ||
@@ -144,7 +145,8 @@ block_plugin_revocation_evaluate (void *cls, | |||
144 | } | 145 | } |
145 | if (0 >= | 146 | if (0 >= |
146 | GNUNET_REVOCATION_check_pow (&rm->proof_of_work, | 147 | GNUNET_REVOCATION_check_pow (&rm->proof_of_work, |
147 | ic->matching_bits)) | 148 | ic->matching_bits, |
149 | ic->epoch_length)) | ||
148 | { | 150 | { |
149 | GNUNET_break_op (0); | 151 | GNUNET_break_op (0); |
150 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; | 152 | return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; |
@@ -208,6 +210,7 @@ libgnunet_plugin_block_revocation_init (void *cls) | |||
208 | struct GNUNET_BLOCK_PluginFunctions *api; | 210 | struct GNUNET_BLOCK_PluginFunctions *api; |
209 | struct InternalContext *ic; | 211 | struct InternalContext *ic; |
210 | unsigned long long matching_bits; | 212 | unsigned long long matching_bits; |
213 | struct GNUNET_TIME_Relative epoch_length; | ||
211 | 214 | ||
212 | if (GNUNET_OK != | 215 | if (GNUNET_OK != |
213 | GNUNET_CONFIGURATION_get_value_number (cfg, | 216 | GNUNET_CONFIGURATION_get_value_number (cfg, |
@@ -215,6 +218,12 @@ libgnunet_plugin_block_revocation_init (void *cls) | |||
215 | "WORKBITS", | 218 | "WORKBITS", |
216 | &matching_bits)) | 219 | &matching_bits)) |
217 | return NULL; | 220 | return NULL; |
221 | if (GNUNET_OK != | ||
222 | GNUNET_CONFIGURATION_get_value_time (cfg, | ||
223 | "REVOCATION", | ||
224 | "EPOCH_LENGTH", | ||
225 | &epoch_length)) | ||
226 | return NULL; | ||
218 | 227 | ||
219 | api = GNUNET_new (struct GNUNET_BLOCK_PluginFunctions); | 228 | api = GNUNET_new (struct GNUNET_BLOCK_PluginFunctions); |
220 | api->evaluate = &block_plugin_revocation_evaluate; | 229 | api->evaluate = &block_plugin_revocation_evaluate; |
@@ -223,6 +232,7 @@ libgnunet_plugin_block_revocation_init (void *cls) | |||
223 | api->types = types; | 232 | api->types = types; |
224 | ic = GNUNET_new (struct InternalContext); | 233 | ic = GNUNET_new (struct InternalContext); |
225 | ic->matching_bits = (unsigned int) matching_bits; | 234 | ic->matching_bits = (unsigned int) matching_bits; |
235 | ic->epoch_length = epoch_length; | ||
226 | api->cls = ic; | 236 | api->cls = ic; |
227 | return api; | 237 | return api; |
228 | } | 238 | } |