From: Nathan S. Evans Date: Fri, 19 Nov 2010 10:09:22 +0000 (+0000) Subject: dont try to send to more peers that exist X-Git-Tag: initial-import-from-subversion-38251~19680 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d88f361070f88763f512c9359bf6c49ad8fb2e9a;p=oweals%2Fgnunet.git dont try to send to more peers that exist --- 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));