From 097a0cfa961e33da64b459b85e604bc3f72ab930 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 9 Oct 2018 15:11:06 +0200 Subject: when zone does not match, do not run through the loop anyway --- src/namestore/gnunet-service-namestore.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c index 2d6020552..e6d82e3f4 100644 --- a/src/namestore/gnunet-service-namestore.c +++ b/src/namestore/gnunet-service-namestore.c @@ -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) { -- cgit v1.2.3