aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mesh/mesh_tunnel_tree.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mesh/mesh_tunnel_tree.c b/src/mesh/mesh_tunnel_tree.c
index c58260601..a01ff2ca7 100644
--- a/src/mesh/mesh_tunnel_tree.c
+++ b/src/mesh/mesh_tunnel_tree.c
@@ -403,14 +403,17 @@ tree_update_first_hops (struct MeshTunnelTree *tree,
403 hop = π 403 hop = π
404 GNUNET_PEER_resolve(old->peer, hop); 404 GNUNET_PEER_resolve(old->peer, hop);
405 } 405 }
406 copy = GNUNET_malloc(sizeof(struct GNUNET_PeerIdentity));
407 *copy = *hop;
408 GNUNET_PEER_resolve(parent->peer, &id); 406 GNUNET_PEER_resolve(parent->peer, &id);
407 copy = GNUNET_CONTAINER_multihashmap_get (tree->first_hops, &id.hashPubKey);
408 if (NULL == copy)
409 copy = GNUNET_malloc(sizeof(struct GNUNET_PeerIdentity));
410 *copy = *hop;
411
409 GNUNET_CONTAINER_multihashmap_put( 412 GNUNET_CONTAINER_multihashmap_put(
410 tree->first_hops, 413 tree->first_hops,
411 &id.hashPubKey, 414 &id.hashPubKey,
412 copy, 415 copy,
413 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST); 416 GNUNET_CONTAINER_MULTIHASHMAPOPTION_REPLACE);
414 417
415 for (n = parent->children_head; NULL != n; n = n->next) 418 for (n = parent->children_head; NULL != n; n = n->next)
416 { 419 {