diff options
author | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2020-04-20 19:08:23 +0200 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2020-04-20 19:08:23 +0200 |
commit | c20768b8b09fabaa3c2330cde381e894b1f90efb (patch) | |
tree | 62bca41b94c3280a09abbf9db8b50da5f354b691 /src/revocation/gnunet-service-revocation.c | |
parent | 424cd50ecd0144b264a547fe149839cf2866c21f (diff) | |
download | gnunet-c20768b8b09fabaa3c2330cde381e894b1f90efb.tar.gz gnunet-c20768b8b09fabaa3c2330cde381e894b1f90efb.zip |
include buffer of 10& of epoch
Diffstat (limited to 'src/revocation/gnunet-service-revocation.c')
-rw-r--r-- | src/revocation/gnunet-service-revocation.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/revocation/gnunet-service-revocation.c b/src/revocation/gnunet-service-revocation.c index 4746a7698..bd35b1055 100644 --- a/src/revocation/gnunet-service-revocation.c +++ b/src/revocation/gnunet-service-revocation.c | |||
@@ -129,6 +129,11 @@ static struct GNUNET_SET_ListenHandle *revocation_union_listen_handle; | |||
129 | static unsigned long long revocation_work_required; | 129 | static unsigned long long revocation_work_required; |
130 | 130 | ||
131 | /** | 131 | /** |
132 | * Length of an expiration expoch | ||
133 | */ | ||
134 | static struct GNUNET_TIME_Relative epoch_length; | ||
135 | |||
136 | /** | ||
132 | * Our application ID for set union operations. Must be the | 137 | * Our application ID for set union operations. Must be the |
133 | * same for all (compatible) peers. | 138 | * same for all (compatible) peers. |
134 | */ | 139 | */ |
@@ -167,8 +172,9 @@ new_peer_entry (const struct GNUNET_PeerIdentity *peer) | |||
167 | static int | 172 | static int |
168 | verify_revoke_message (const struct RevokeMessage *rm) | 173 | verify_revoke_message (const struct RevokeMessage *rm) |
169 | { | 174 | { |
170 | if (0 >= GNUNET_REVOCATION_check_pow (&rm->proof_of_work, | 175 | if (GNUNET_YES != GNUNET_REVOCATION_check_pow (&rm->proof_of_work, |
171 | (unsigned int) revocation_work_required)) | 176 | (unsigned int) revocation_work_required, |
177 | epoch_length)) | ||
172 | { | 178 | { |
173 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 179 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
174 | "Proof of work invalid!\n"); | 180 | "Proof of work invalid!\n"); |
@@ -846,6 +852,20 @@ run (void *cls, | |||
846 | GNUNET_free (fn); | 852 | GNUNET_free (fn); |
847 | return; | 853 | return; |
848 | } | 854 | } |
855 | if (GNUNET_OK != | ||
856 | GNUNET_CONFIGURATION_get_value_time (cfg, | ||
857 | "REVOCATION", | ||
858 | "EPOCH_LENGTH", | ||
859 | &epoch_length)) | ||
860 | { | ||
861 | GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, | ||
862 | "REVOCATION", | ||
863 | "EPOCH_LENGTH"); | ||
864 | GNUNET_SCHEDULER_shutdown (); | ||
865 | GNUNET_free (fn); | ||
866 | return; | ||
867 | } | ||
868 | |||
849 | revocation_set = GNUNET_SET_create (cfg, | 869 | revocation_set = GNUNET_SET_create (cfg, |
850 | GNUNET_SET_OPERATION_UNION); | 870 | GNUNET_SET_OPERATION_UNION); |
851 | revocation_union_listen_handle | 871 | revocation_union_listen_handle |