-conversion to absolute time is now done in GNUNET_GNSRECORD_block_create
authorChristian Grothoff <christian@grothoff.org>
Fri, 18 Oct 2013 13:36:24 +0000 (13:36 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 18 Oct 2013 13:36:24 +0000 (13:36 +0000)
src/gns/gnunet-service-gns.c

index fcbecb4e67c91ce5b00509d94e2241a6c627e3f5..cc2bf3fdfc6c515f244d62e7ffbfe0cf29f404d9 100644 (file)
@@ -415,11 +415,16 @@ put_gns_record (void *cls,
       rd_public[rd_public_count] = rd[i];
       if (0 != (rd[i].flags & GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION))
       {
+        /* GNUNET_GNSRECORD_block_create will convert to absolute time;
+           we just need to adjust our iteration frequency */
         min_relative_record_time.rel_value_us =
           GNUNET_MIN (rd_public[rd_public_count].expiration_time,
                       min_relative_record_time.rel_value_us);
-       rd_public[rd_public_count].flags &= ~GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION;
-       rd_public[rd_public_count].expiration_time += now.abs_value_us;
+      }
+      else if (rd_public[rd_public_count].expiration_time < now.abs_value_us)
+      {
+        /* record already expired, skip it */
+        continue;
       }
       rd_public_count++;
     }