aboutsummaryrefslogtreecommitdiff
path: root/src/revocation/revocation_api.c
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 /src/revocation/revocation_api.c
parent19e3bd32adb2f8926b78bbec7a17c3b1c11b716e (diff)
downloadgnunet-3be8295f2fac6890f2ff0e312c39aecda8b25342.tar.gz
gnunet-3be8295f2fac6890f2ff0e312c39aecda8b25342.zip
actually add ttl
Diffstat (limited to 'src/revocation/revocation_api.c')
-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,
492 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 492 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
493 "Score %u with %" PRIu64 " (#%u)\n", 493 "Score %u with %" PRIu64 " (#%u)\n",
494 tmp_score, pow_val, i); 494 tmp_score, pow_val, i);
495 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
496 "First byte: %x\n",
497 ((char*)&result)[0] & 0xff);
498
495 499
496 GNUNET_CRYPTO_hash_to_enc (&result, 500 GNUNET_CRYPTO_hash_to_enc (&result,
497 &h_str); 501 &h_str);
@@ -583,9 +587,14 @@ GNUNET_REVOCATION_pow_start (struct GNUNET_REVOCATION_PowP *pow,
583 unsigned int difficulty) 587 unsigned int difficulty)
584{ 588{
585 struct GNUNET_REVOCATION_PowCalculationHandle *pc; 589 struct GNUNET_REVOCATION_PowCalculationHandle *pc;
590 struct GNUNET_TIME_Relative ttl;
591
586 592
587 pc = GNUNET_new (struct GNUNET_REVOCATION_PowCalculationHandle); 593 pc = GNUNET_new (struct GNUNET_REVOCATION_PowCalculationHandle);
588 pc->pow = pow; 594 pc->pow = pow;
595 ttl = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_YEARS,
596 epochs);
597 pc->pow->ttl = GNUNET_TIME_relative_hton (ttl);
589 pc->current_pow = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, 598 pc->current_pow = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK,
590 UINT64_MAX); 599 UINT64_MAX);
591 pc->difficulty = difficulty; 600 pc->difficulty = difficulty;