fix bug where we might fail the resolution of the same DHT heap node twice due to...
authorChristian Grothoff <christian@grothoff.org>
Wed, 23 May 2018 21:08:03 +0000 (23:08 +0200)
committerChristian Grothoff <christian@grothoff.org>
Wed, 23 May 2018 21:08:15 +0000 (23:08 +0200)
src/gns/gnunet-service-gns_resolver.c

index 8593e281eb9a5b6fa987b5c6ac8397525fb702be..d3c07e9977695d29d97cf23f5abff173bd5e2da7 100644 (file)
@@ -2400,7 +2400,8 @@ start_dht_request (struct GNS_ResolverHandle *rh,
   if (GNUNET_CONTAINER_heap_get_size (dht_lookup_heap) > max_allowed_background_queries)
   {
     /* fail longest-standing DHT request */
-    rx = GNUNET_CONTAINER_heap_peek (dht_lookup_heap);
+    rx = GNUNET_CONTAINER_heap_remove_root (dht_lookup_heap);
+    rx->dht_heap_node = NULL;
     GNUNET_assert (NULL != rx);
     fail_resolution (rx);
   }