fix
authorChristian Grothoff <christian@grothoff.org>
Wed, 9 Nov 2011 08:48:00 +0000 (08:48 +0000)
committerChristian Grothoff <christian@grothoff.org>
Wed, 9 Nov 2011 08:48:00 +0000 (08:48 +0000)
src/transport/gnunet-service-transport_neighbours.c
src/transport/gnunet-service-transport_validation.c

index a127209dd97d132d7e2c53697d1b4ea3b83be25d..7dbe2643680fe3ccfcc6c1c42bad9d520fbd958d 100644 (file)
@@ -1397,7 +1397,8 @@ GST_neighbour_get_latency (const struct GNUNET_PeerIdentity *peer)
   struct NeighbourMapEntry *n;
 
   n = lookup_neighbour (peer);
-  if (NULL == n)
+  if ( (NULL == n) ||
+       ( (n->address == NULL) && (n->session == NULL) ) )
     return GNUNET_TIME_UNIT_FOREVER_REL;
   return GST_validation_get_address_latency (peer,
                                             n->address,
index 9b93c75085d688bdf6efef2b82bd4278e8a30ff5..9b0fc07324232b3f297e93e934303ea71b3463b7 100644 (file)
@@ -1208,6 +1208,11 @@ GST_validation_get_address_latency (const struct GNUNET_PeerIdentity *sender,
 {
   struct ValidationEntry *ve;
 
+  if (NULL == address)
+  {
+    GNUNET_break (0); // FIXME: support having latency only with session...
+    return GNUNET_TIME_UNIT_FOREVER_REL;
+  }
   ve = find_validation_entry (NULL, address);
   if (NULL == ve)
     return GNUNET_TIME_UNIT_FOREVER_REL;