#include "platform.h"
#include "gnunet_peer_lib.h"
+#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+
struct PeerEntry
{
return 0;
off = (long) GNUNET_CONTAINER_multihashmap_get (map, &pid->hashPubKey);
e = (off == 0) ? NULL : &table[off];
- if (e != NULL)
- {
- GNUNET_assert (e->rc > 0);
- return e->pid;
- }
- else
- {
+ if (e == NULL)
return 0;
- }
+ GNUNET_assert (e->rc > 0);
+ return e->pid;
}
+
/**
* Intern an peer identity. If the identity is already known, its
* reference counter will be increased by one.
/**
* Decrement multiple RCs of peer identities by one.
- *
+ *
* @param ids array of PIDs to decrement the RCs of
* @param count size of the ids array
*/
{
GNUNET_break (GNUNET_OK ==
GNUNET_CONTAINER_multihashmap_remove (map,
- &table[id].id.
- hashPubKey,
+ &table[id].
+ id.hashPubKey,
(void *) (long) id));
table[id].pid = free_list_start;
free_list_start = id;
{
GNUNET_break (GNUNET_OK ==
GNUNET_CONTAINER_multihashmap_remove (map,
- &table[id].id.
- hashPubKey,
+ &table[id].
+ id.hashPubKey,
(void *) (long) id));
table[id].pid = free_list_start;
free_list_start = id;