- Fix for #2183: own position in tree only checked on new nodes caused assertion...
authorBart Polot <bart@net.in.tum.de>
Tue, 6 Mar 2012 15:57:24 +0000 (15:57 +0000)
committerBart Polot <bart@net.in.tum.de>
Tue, 6 Mar 2012 15:57:24 +0000 (15:57 +0000)
src/mesh/mesh_tunnel_tree.c

index 445b7100d171b2cb2fa95206f2338e9670dd464e..287eefc7b2f07a4532e3c6555a0939f20ed12331 100644 (file)
@@ -837,7 +837,7 @@ tree_add_path (struct MeshTunnelTree *t, const struct MeshPeerPath *p,
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "tree:   Adding peer %s.\n",
                 GNUNET_i2s (&id));
     GNUNET_PEER_resolve (parent->peer, &id);
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "tree:     to %s.\n",
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "tree:            to %s.\n",
                 GNUNET_i2s (&id));
 #endif
 
@@ -860,11 +860,11 @@ tree_add_path (struct MeshTunnelTree *t, const struct MeshPeerPath *p,
 #endif
       n = tree_node_new (parent, p->peers[i]);
       n->status = MESH_PEER_RELAY;
-      if (n->peer == 1)
-      {
-        t->me = n;
-        me = i;
-      }
+    }
+    if (n->peer == 1)
+    {
+      t->me = n;
+      me = i;
     }
     i++;
     parent = n;