- if (GNUNET_CONTAINER_multihashmap_size(min_ctx->first->connect_peers_working_set) < min_ctx->num_to_add)
- {
- for (i = 0; i < min_ctx->num_to_add; i++)
- {
- if (min_ctx->pg_array[i] == min_ctx->current)
- {
- GNUNET_assert(GNUNET_OK == GNUNET_CONTAINER_multihashmap_put(min_ctx->first->connect_peers_working_set, key, value, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
- uid_from_hash(key, &second_pos);
- hash_from_uid(min_ctx->first_uid, &first_hash);
- GNUNET_assert(min_ctx->pg->total > second_pos);
- GNUNET_assert(GNUNET_OK == GNUNET_CONTAINER_multihashmap_put(min_ctx->pg->peers[second_pos].connect_peers_working_set, &first_hash, min_ctx->first->daemon, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
- /* Now we have added this particular connection, remove it from the second peer's map so it's not double counted */
- GNUNET_assert(GNUNET_YES == GNUNET_CONTAINER_multihashmap_remove(min_ctx->pg->peers[second_pos].connect_peers, &first_hash, min_ctx->first->daemon));
- }
- }
- min_ctx->current++;
- return GNUNET_YES;
- }
+ if (GNUNET_CONTAINER_multihashmap_size
+ (min_ctx->first->connect_peers_working_set) < min_ctx->num_to_add)
+ {
+ for (i = 0; i < min_ctx->num_to_add; i++)
+ {
+ if (min_ctx->pg_array[i] == min_ctx->current)
+ {
+ GNUNET_assert (GNUNET_OK ==
+ GNUNET_CONTAINER_multihashmap_put
+ (min_ctx->first->connect_peers_working_set, key,
+ value,
+ GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
+ uid_from_hash (key, &second_pos);
+ hash_from_uid (min_ctx->first_uid, &first_hash);
+ GNUNET_assert (min_ctx->pg->total > second_pos);
+ GNUNET_assert (GNUNET_OK ==
+ GNUNET_CONTAINER_multihashmap_put (min_ctx->
+ pg->peers
+ [second_pos].connect_peers_working_set,
+ &first_hash,
+ min_ctx->first->
+ daemon,
+ GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
+ /* Now we have added this particular connection, remove it from the second peer's map so it's not double counted */
+ GNUNET_assert (GNUNET_YES ==
+ GNUNET_CONTAINER_multihashmap_remove
+ (min_ctx->pg->peers[second_pos].connect_peers,
+ &first_hash, min_ctx->first->daemon));
+ }
+ }
+ min_ctx->current++;
+ return GNUNET_YES;
+ }