gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r36713 - gnunet/src/rps


From: gnunet
Subject: [GNUnet-SVN] r36713 - gnunet/src/rps
Date: Tue, 1 Dec 2015 19:25:37 +0100

Author: ch3
Date: 2015-12-01 19:25:37 +0100 (Tue, 01 Dec 2015)
New Revision: 36713

Modified:
   gnunet/src/rps/gnunet-service-rps.c
Log:
-removed obsolete functions

Signed-off-by: Julius Bunger <address@hidden>

Modified: gnunet/src/rps/gnunet-service-rps.c
===================================================================
--- gnunet/src/rps/gnunet-service-rps.c 2015-12-01 18:25:32 UTC (rev 36712)
+++ gnunet/src/rps/gnunet-service-rps.c 2015-12-01 18:25:37 UTC (rev 36713)
@@ -67,11 +67,6 @@
 static struct GNUNET_PeerIdentity own_identity;
 
 
-  struct GNUNET_PeerIdentity *
-get_rand_peer_ignore_list (const struct GNUNET_PeerIdentity *peer_list, 
unsigned int size,
-                           const struct GNUNET_PeerIdentity *ignore_list, 
unsigned int ignore_size);
-
-
 /***********************************************************************
  * Housekeeping with peers
 ***********************************************************************/
@@ -544,30 +539,6 @@
 
 
 /**
- * Check if peer is already in peer array.
- */
-  int
-in_arr (const struct GNUNET_PeerIdentity *array,
-        unsigned int arr_size,
-        const struct GNUNET_PeerIdentity *peer)
-{
-  GNUNET_assert (NULL != peer);
-
-  if (0 == arr_size)
-    return GNUNET_NO;
-
-  GNUNET_assert (NULL != array);
-
-  unsigned int i;
-
-  for (i = 0; i < arr_size ; i++)
-    if (0 == GNUNET_CRYPTO_cmp_peer_identity (&array[i], peer))
-      return GNUNET_YES;
-  return GNUNET_NO;
-}
-
-
-/**
  * Print peerlist to log.
  */
 void
@@ -622,68 +593,7 @@
   *peer_list = tmp;
 }
 
-/**
- * Get random peer from the given list but don't return one from the @a 
ignore_list.
- */
-  struct GNUNET_PeerIdentity *
-get_rand_peer_ignore_list (const struct GNUNET_PeerIdentity *peer_list,
-                           uint32_t list_size,
-                           const struct GNUNET_PeerIdentity *ignore_list,
-                           uint32_t ignore_size)
-{
-  uint32_t r_index;
-  uint32_t tmp_size;
-  struct GNUNET_PeerIdentity *tmp_peer_list;
-  struct GNUNET_PeerIdentity *peer;
 
-  GNUNET_assert (NULL != peer_list);
-  if (0 == list_size)
-    return NULL;
-
-  tmp_size = 0;
-  tmp_peer_list = NULL;
-  GNUNET_array_grow (tmp_peer_list, tmp_size, list_size);
-  memcpy (tmp_peer_list,
-          peer_list,
-          list_size * sizeof (struct GNUNET_PeerIdentity));
-  peer = GNUNET_new (struct GNUNET_PeerIdentity);
-
-  /**;
-   * Choose the r_index of the peer we want to return
-   * at random from the interval of the view
-   */
-  r_index = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_STRONG,
-                                      tmp_size);
-  *peer = tmp_peer_list[r_index];
-
-  while (in_arr (ignore_list, ignore_size, peer))
-  {
-    rem_from_list (&tmp_peer_list, &tmp_size, peer);
-
-    print_peer_list (tmp_peer_list, tmp_size);
-
-    if (0 == tmp_size)
-    {
-      GNUNET_free (peer);
-      return NULL;
-    }
-
-    /**;
-     * Choose the r_index of the peer we want to return
-     * at random from the interval of the view
-     */
-    r_index = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_STRONG,
-                                        tmp_size);
-    *peer = tmp_peer_list[r_index];
-  }
-
-
-  GNUNET_array_grow (tmp_peer_list, tmp_size, 0);
-
-  return peer;
-}
-
-
 /**
  * Get the context of a peer. If not existing, create.
  */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]