summaryrefslogtreecommitdiff
path: root/src/revocation/plugin_block_revocation.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/revocation/plugin_block_revocation.c')
-rw-r--r--src/revocation/plugin_block_revocation.c12
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 @@
struct InternalContext
{
unsigned int matching_bits;
+ struct GNUNET_TIME_Relative epoch_length;
};
@@ -144,7 +145,8 @@ block_plugin_revocation_evaluate (void *cls,
}
if (0 >=
GNUNET_REVOCATION_check_pow (&rm->proof_of_work,
- ic->matching_bits))
+ ic->matching_bits,
+ ic->epoch_length))
{
GNUNET_break_op (0);
return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
@@ -208,6 +210,7 @@ libgnunet_plugin_block_revocation_init (void *cls)
struct GNUNET_BLOCK_PluginFunctions *api;
struct InternalContext *ic;
unsigned long long matching_bits;
+ struct GNUNET_TIME_Relative epoch_length;
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_number (cfg,
@@ -215,6 +218,12 @@ libgnunet_plugin_block_revocation_init (void *cls)
"WORKBITS",
&matching_bits))
return NULL;
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_time (cfg,
+ "REVOCATION",
+ "EPOCH_LENGTH",
+ &epoch_length))
+ return NULL;
api = GNUNET_new (struct GNUNET_BLOCK_PluginFunctions);
api->evaluate = &block_plugin_revocation_evaluate;
@@ -223,6 +232,7 @@ libgnunet_plugin_block_revocation_init (void *cls)
api->types = types;
ic = GNUNET_new (struct InternalContext);
ic->matching_bits = (unsigned int) matching_bits;
+ ic->epoch_length = epoch_length;
api->cls = ic;
return api;
}