c->status.active = false;
- if(c->node)
+ if(c->node && c->node->connection == c)
c->node->connection = NULL;
if(c->edge) {
send_del_edge(everyone, c->edge);
edge_del(c->edge);
+ c->edge = NULL;
/* Run MST and SSSP algorithms */
/* Check if this was our outgoing connection */
if(c->outgoing) {
- do_outgoing_connection(c);
- }
+ do_outgoing_connection(c);
+ } else {
+ connection_del(c);
+ }
}
/*