} else if(strcmp(fsa_our_uname, vote_from) == 0) { crm_debug("Election ??pass??: dup uname"); CRM_DEV_ASSERT(strcmp(fsa_our_uname, vote_from) != 0);
do_election_count_vote(long long action,		       enum crmd_fsa_cause cause,		       enum crmd_fsa_state cur_state,		       enum crmd_fsa_input current_input,		       fsa_data_t *msg_data){	gboolean we_loose = FALSE;	ha_msg_input_t *vote = fsa_typed_data(fsa_dt_ha_msg);	enum crmd_fsa_input election_result = I_NULL;	const char *vote_from    = cl_get_string(vote->msg, F_CRM_HOST_FROM);	const char *your_version = cl_get_string(vote->msg, F_CRM_VERSION);	oc_node_t *our_node = NULL, * your_node = NULL;	if(vote_from == NULL || strcmp(vote_from, fsa_our_uname) == 0) {		/* dont count our own vote */		return election_result;	}	if(fsa_membership_copy == NULL) {		/* if the membership copy is NULL we REALLY shouldnt be voting		 * the question is how we managed to get here.		 */		crm_err("Membership copy was NULL");		return I_NULL;			} else if(fsa_membership_copy->members_size < 1) {				/* if even we are not in the cluster then we should not vote */		return I_NULL;	}	our_node = (oc_node_t*)		g_hash_table_lookup(fsa_membership_copy->members,fsa_our_uname);	your_node = (oc_node_t*)		g_hash_table_lookup(fsa_membership_copy->members,vote_from);	/* if your_version == 0, then they're shutting down too */	if(is_set(fsa_input_register, R_SHUTDOWN)) {		if(your_version != 0) {			crm_debug("Election fail: we are shutting down");			we_loose = TRUE;		} else {			/* pretend nothing happened, they want to shutdown too*/			return I_NULL;		}			} else if(our_node == NULL		|| fsa_membership_copy->last_event == OC_EV_MS_EVICTED) {		crm_debug("Election fail: we dont exist in CCM");		we_loose = TRUE;			} else if(your_node == NULL) {		crm_err("The other side doesnt exist in CCM.  Ignoring vote.");		return I_NULL;			} else if(compare_version(your_version, CRM_VERSION) > 0) {		crm_debug("Election fail: version");		we_loose = TRUE;			} else if(compare_version(your_version, CRM_VERSION) < 0) {		crm_debug("Election pass: version");			} else if(your_node->node_born_on < our_node->node_born_on) {		crm_debug("Election fail: born_on");		we_loose = TRUE;	} else if(your_node->node_born_on > our_node->node_born_on) {		crm_debug("Election pass: born_on");			} else if(strcmp(fsa_our_uname, vote_from) > 0) {		crm_debug("Election fail: uname");		we_loose = TRUE;	} else if(strcmp(fsa_our_uname, vote_from) == 0) {		crm_debug("Election ??pass??: dup uname");		CRM_DEV_ASSERT(strcmp(fsa_our_uname, vote_from) != 0);	}	if(we_loose) {		stopTimer(election_timeout);		fsa_cib_conn->cmds->set_slave(fsa_cib_conn, cib_scope_local);		crm_info("Election lost to %s", vote_from);		if(fsa_input_register & R_THE_DC) {			crm_devel("Give up the DC to %s", vote_from);			election_result = I_RELEASE_DC;					} else {			crm_devel("We werent the DC anyway");			election_result = I_PENDING;					}	} else {		crm_info("Election won over %s", vote_from);#if 0		if(cur_state == S_PENDING) {			crm_info("We already lost the election");					} else if(highest_born_on == 0		   || your_node->node_born_on < highest_born_on) {			election_result = I_ELECTION;			highest_born_on = your_node->node_born_on;		} else {			crm_info("We've already voted down nodes born on %d and"				 " later.  %s born on %d", highest_born_on,				 vote_from, your_node->node_born_on);		}#else		if(cur_state == S_PENDING) {			crm_info("We already lost the election");			return I_NULL;					} else {			election_result = I_ELECTION;		}#endif	}		register_fsa_input(C_FSA_INTERNAL, election_result, NULL);	return I_NULL;}