+/**
+ * Clean the send channel of a peer
+ * If there is also no channel to receive messages from that peer, remove it
+ * from the peermap.
+ */
+void
+peer_clean (const struct GNUNET_PeerIdentity *peer)
+{
+ struct PeerContext *peer_ctx;
+ /* struct GNUNET_CADET_Channel *channel; */
+
+ if (GNUNET_YES != GNUNET_CONTAINER_multipeermap_contains (view, peer) &&
+ GNUNET_YES == GNUNET_CONTAINER_multipeermap_contains (peer_map, peer))
+ {
+ peer_ctx = get_peer_ctx (peer_map, peer);
+ GNUNET_CADET_channel_destroy (peer_ctx->send_channel);
+ peer_ctx->send_channel = NULL;
+
+ if (NULL == peer_ctx->recv_channel)
+ {
+ peer_remove_cb (NULL, peer, peer_ctx);
+ }
+ }
+}
+
+