when zone does not match, do not run through the loop anyway
authorChristian Grothoff <christian@grothoff.org>
Tue, 9 Oct 2018 13:11:06 +0000 (15:11 +0200)
committerChristian Grothoff <christian@grothoff.org>
Tue, 9 Oct 2018 13:11:06 +0000 (15:11 +0200)
src/namestore/gnunet-service-namestore.c

index 2d60205526fc1b9b80242b4303dae092065b8b2d..e6d82e3f4603d2313bf28fc8c5c1d65d204d8ec7 100644 (file)
@@ -920,7 +920,10 @@ continue_store_activity (struct StoreActivity *sa)
            (0 != memcmp (&zm->zone,
                          &zero,
                          sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) )
-        sa->zm_pos = zm->next; /* not interesting to this monitor */
+       {
+         sa->zm_pos = zm->next; /* not interesting to this monitor */
+         continue;
+       }
       if (zm->limit == zm->iteration_cnt)
       {
         zm->sa_waiting = GNUNET_YES;
@@ -1977,6 +1980,16 @@ monitor_iterate_cb (void *cls,
 {
   struct ZoneMonitor *zm = cls;
 
+  if ( (0 != memcmp (&zone_key,
+                    &zm->zone,
+                    sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) &&
+       (0 != memcmp (&zm->zone,
+                    &zero,
+                    sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) )
+  {
+    GNUNET_break (0);
+    return;
+  }
   zm->seq = seq;
   if (NULL == name)
   {