if (find_peer_ctx->total > max_outstanding_find_peers)
find_peer_ctx->total = max_outstanding_find_peers;
- if (find_peer_ctx->total > GNUNET_CONTAINER_heap_get_size(find_peer_ctx->peer_min_heap)) /* Don't try to send more messages than we have peers! */
- find_peer_ctx->total = GNUNET_CONTAINER_heap_get_size(find_peer_ctx->peer_min_heap);
+ if (find_peer_ctx->total > num_peers) /* Don't try to send more messages than we have peers! */
+ find_peer_ctx->total = num_peers;
find_peer_ctx->last_sent = find_peer_ctx->total;
GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Sending %u find peer messages (goal at least %u connections)\n", find_peer_ctx->total, connection_estimate(num_peers, DEFAULT_BUCKET_SIZE));