update the cost later
authorPhilipp Tölke <toelke@in.tum.de>
Wed, 15 Jun 2011 07:15:37 +0000 (07:15 +0000)
committerPhilipp Tölke <toelke@in.tum.de>
Wed, 15 Jun 2011 07:15:37 +0000 (07:15 +0000)
src/vpn/gnunet-daemon-vpn.c

index 34a480a3efd9538144ee753c55d5940a56496737..49a33a7bb8fbd73da2788cd79cbd52f1dbdcc3c9 100644 (file)
@@ -357,9 +357,6 @@ process_answer(void* cls, const struct GNUNET_SCHEDULER_TaskContext* tc) {
          }
 
        struct map_entry* map_entry = GNUNET_CONTAINER_multihashmap_get(hashmap, &key);
-        GNUNET_CONTAINER_heap_update_cost (heap, map_entry->heap_node,
-                                           GNUNET_TIME_absolute_get ().abs_value);
-
        uint16_t offset = ntohs(pkt->addroffset);
 
        if (map_entry == NULL)
@@ -368,6 +365,10 @@ process_answer(void* cls, const struct GNUNET_SCHEDULER_TaskContext* tc) {
            return;
          }
 
+        GNUNET_CONTAINER_heap_update_cost (heap, map_entry->heap_node,
+                                           GNUNET_TIME_absolute_get ().abs_value);
+
+
         unsigned short namelen = htons(map_entry->namelen);
        char* name = (char*)(map_entry + 1);