- fix
[oweals/gnunet.git] / src / mesh / gnunet-service-mesh_dht.c
index 279645d66561893da4ba35e84fb70a21655b28e7..01fb4a30f2f59bc82d4ac62faa78f9a5006b3c9a 100644 (file)
@@ -253,6 +253,8 @@ announce_id (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   struct GNUNET_HashCode phash;
   const struct GNUNET_HELLO_Message *hello;
   size_t size;
+  struct GNUNET_TIME_Absolute expiration;
+  struct GNUNET_TIME_Relative retry_time;
 
   if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
   {
@@ -274,6 +276,8 @@ announce_id (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
     LOG (GNUNET_ERROR_TYPE_DEBUG, "  no hello, waiting!\n");
     return;
   }
+  expiration = GNUNET_HELLO_get_last_expiration (hello);
+  retry_time = GNUNET_TIME_absolute_get_remaining (expiration);
 
   LOG (GNUNET_ERROR_TYPE_DEBUG, "Hello %p size: %u\n", hello, size);
   memset (&phash, 0, sizeof (phash));
@@ -286,8 +290,8 @@ announce_id (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
                   GNUNET_BLOCK_TYPE_DHT_HELLO,       /* Block type */
                   size,  /* Size of the data */
                   (const char *) hello, /* Data itself */
-                  GNUNET_TIME_UNIT_FOREVER_ABS,  /* Data expiration */
-                  GNUNET_TIME_UNIT_FOREVER_REL, /* Retry time */
+                  expiration,  /* Data expiration */
+                  retry_time, /* Retry time */
                   NULL,         /* Continuation */
                   NULL);        /* Continuation closure */
   announce_id_task =