int
GSC_NEIGHBOURS_init ()
{
- neighbours = GNUNET_CONTAINER_multihashmap_create (128);
+ neighbours = GNUNET_CONTAINER_multihashmap_create (128, GNUNET_NO);
transport =
GNUNET_TRANSPORT_connect (GSC_cfg, &GSC_my_identity, NULL,
&handle_transport_receive,
void
GSC_NEIGHBOURS_done ()
{
- if (NULL == transport)
- return;
- GNUNET_TRANSPORT_disconnect (transport);
- transport = NULL;
- GNUNET_CONTAINER_multihashmap_iterate (neighbours, &free_neighbour_helper,
- NULL);
- GNUNET_CONTAINER_multihashmap_destroy (neighbours);
- neighbours = NULL;
+ if (NULL != transport)
+ {
+ GNUNET_TRANSPORT_disconnect (transport);
+ transport = NULL;
+ }
+ if (NULL != neighbours)
+ {
+ GNUNET_CONTAINER_multihashmap_iterate (neighbours, &free_neighbour_helper,
+ NULL);
+ GNUNET_CONTAINER_multihashmap_destroy (neighbours);
+ neighbours = NULL;
+ }
}
/* end of gnunet-service-core_neighbours.c */