aboutsummaryrefslogtreecommitdiff
path: root/src/util/gnunet-scrypt.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-04-09 23:14:03 +0000
committerChristian Grothoff <christian@grothoff.org>2016-04-09 23:14:03 +0000
commit29e6158507a0758192075ac6ece7ba8e75ddc49a (patch)
treeb91ded48da322f8ba4c9bb0f5504228aa036c2d1 /src/util/gnunet-scrypt.c
parent5dfcb058ab5db9ae0c4b147d8a99c64ca0980028 (diff)
downloadgnunet-29e6158507a0758192075ac6ece7ba8e75ddc49a.tar.gz
gnunet-29e6158507a0758192075ac6ece7ba8e75ddc49a.zip
small API change: do no longer pass rarely needed GNUNET_SCHEDULER_TaskContext to all scheduler tasks; instead, allow the relatively few tasks that need it to obtain the context via GNUNET_SCHEDULER_get_task_context()
Diffstat (limited to 'src/util/gnunet-scrypt.c')
-rw-r--r--src/util/gnunet-scrypt.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/util/gnunet-scrypt.c b/src/util/gnunet-scrypt.c
index 434574ef0..7449d8042 100644
--- a/src/util/gnunet-scrypt.c
+++ b/src/util/gnunet-scrypt.c
@@ -110,8 +110,7 @@ count_leading_zeroes (const struct GNUNET_HashCode *hash)
110 * @param tc task context 110 * @param tc task context
111 */ 111 */
112static void 112static void
113find_proof (void *cls, 113find_proof (void *cls)
114 const struct GNUNET_SCHEDULER_TaskContext *tc)
115{ 114{
116 #define ROUND_SIZE 10 115 #define ROUND_SIZE 10
117 uint64_t counter; 116 uint64_t counter;
@@ -121,7 +120,9 @@ find_proof (void *cls,
121 unsigned int i; 120 unsigned int i;
122 struct GNUNET_TIME_Absolute timestamp; 121 struct GNUNET_TIME_Absolute timestamp;
123 struct GNUNET_TIME_Relative elapsed; 122 struct GNUNET_TIME_Relative elapsed;
123 const struct GNUNET_SCHEDULER_TaskContext *tc;
124 124
125 tc = GNUNET_SCHEDULER_get_task_context ();
125 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) 126 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
126 { 127 {
127 write_proof (); 128 write_proof ();