summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schanzenbach <mschanzenbach@posteo.de>2020-05-25 22:19:07 +0200
committerMartin Schanzenbach <mschanzenbach@posteo.de>2020-05-25 22:19:07 +0200
commit3be8295f2fac6890f2ff0e312c39aecda8b25342 (patch)
tree5c0140f4542a93f8248c5335cdd96227be66f02e
parent19e3bd32adb2f8926b78bbec7a17c3b1c11b716e (diff)
actually add ttl
-rw-r--r--src/revocation/revocation_api.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/revocation/revocation_api.c b/src/revocation/revocation_api.c
index 3789e6799..24e9766ad 100644
--- a/src/revocation/revocation_api.c
+++ b/src/revocation/revocation_api.c
@@ -492,6 +492,10 @@ GNUNET_REVOCATION_check_pow (const struct GNUNET_REVOCATION_PowP *pow,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Score %u with %" PRIu64 " (#%u)\n",
tmp_score, pow_val, i);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "First byte: %x\n",
+ ((char*)&result)[0] & 0xff);
+
GNUNET_CRYPTO_hash_to_enc (&result,
&h_str);
@@ -583,9 +587,14 @@ GNUNET_REVOCATION_pow_start (struct GNUNET_REVOCATION_PowP *pow,
unsigned int difficulty)
{
struct GNUNET_REVOCATION_PowCalculationHandle *pc;
+ struct GNUNET_TIME_Relative ttl;
+
pc = GNUNET_new (struct GNUNET_REVOCATION_PowCalculationHandle);
pc->pow = pow;
+ ttl = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_YEARS,
+ epochs);
+ pc->pow->ttl = GNUNET_TIME_relative_hton (ttl);
pc->current_pow = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK,
UINT64_MAX);
pc->difficulty = difficulty;