if (0 == GNUNET_CRYPTO_cmp_peer_identity (other, &(s_elem->peer_id)))
{
- LOG (GNUNET_ERROR_TYPE_DEBUG, " Got PeerID %s\n",
- GNUNET_i2s (other));
LOG (GNUNET_ERROR_TYPE_DEBUG, "Have already PeerID %s\n",
GNUNET_i2s (&(s_elem->peer_id)));
}
}
else if (0 > GNUNET_CRYPTO_hash_cmp (&other_hash, &s_elem->peer_id_hash))
{
- LOG (GNUNET_ERROR_TYPE_DEBUG, " Got PeerID %s\n",
- GNUNET_i2s (other));
LOG (GNUNET_ERROR_TYPE_DEBUG, "Discarding old PeerID %s\n",
GNUNET_i2s (&s_elem->peer_id));
s_elem->peer_id = *other;
}
else
{
- LOG (GNUNET_ERROR_TYPE_DEBUG, " Got PeerID %s\n",
- GNUNET_i2s (other));
LOG (GNUNET_ERROR_TYPE_DEBUG, "Keeping old PeerID %s\n",
GNUNET_i2s (&s_elem->peer_id));
}
GNUNET_i2s_full (&s_elem->peer_id));
}
+/**
+ * Initialise the min-wise independent function of the given sampler element.
+ *
+ * @param s_elem the sampler element
+ * @param auth_key the key to use
+ */
+void
+RPS_sampler_elem_set (struct RPS_SamplerElement *s_elem,
+ struct GNUNET_CRYPTO_AuthKey auth_key)
+{
+ s_elem->auth_key = auth_key;
+
+ #ifdef TO_FILE
+ /* Create a file(-name) to store internals to */
+ char *name_buf;
+ name_buf = auth_key_to_string (s_elem->auth_key);
+
+ s_elem->file_name = create_file (name_buf);
+ GNUNET_free (name_buf);
+ #endif /* TO_FILE */
+}
+
/* end of gnunet-service-rps.c */