fix present check for on-demand blocks
authorChristian Grothoff <christian@grothoff.org>
Thu, 9 Sep 2010 11:43:12 +0000 (11:43 +0000)
committerChristian Grothoff <christian@grothoff.org>
Thu, 9 Sep 2010 11:43:12 +0000 (11:43 +0000)
src/datastore/gnunet-service-datastore.c

index 01778b1b790ceb0287c9987d8bafc80f47a5de7f..3e9e2e4806f47d8a6adcb3590fc804c5c8867dfe 100644 (file)
@@ -1038,10 +1038,12 @@ check_present (void *cls,
       GNUNET_free (pc);
       return GNUNET_SYSERR;
     }
-  if ( (size == ntohl(dm->size)) &&
-       (0 == memcmp (&dm[1],
-                    data,
-                    size)) )
+  if ( (GNUNET_BLOCK_TYPE_DBLOCK == type) ||
+       (GNUNET_BLOCK_TYPE_IBLOCK == type) ||
+       ( (size == ntohl(dm->size)) &&
+        (0 == memcmp (&dm[1],
+                      data,
+                      size)) ) )
     {
       pc->is_present = GNUNET_YES;
       plugin->api->next_request (next_cls, GNUNET_YES);