From d88f361070f88763f512c9359bf6c49ad8fb2e9a Mon Sep 17 00:00:00 2001 From: "Nathan S. Evans" Date: Fri, 19 Nov 2010 10:09:22 +0000 Subject: [PATCH] dont try to send to more peers that exist --- src/dht/gnunet-dht-driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dht/gnunet-dht-driver.c b/src/dht/gnunet-dht-driver.c index 7f2447c13..47493c256 100644 --- a/src/dht/gnunet-dht-driver.c +++ b/src/dht/gnunet-dht-driver.c @@ -2014,8 +2014,8 @@ schedule_find_peer_requests (void *cls, const struct GNUNET_SCHEDULER_TaskContex 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)); -- 2.25.1