I was looking into the code of im-online
pallet and found the following function here, if false is returned, a heartbeat is sent else AlreadyOnline
Error is returned;
fn is_online_aux(authority_index: AuthIndex, authority: &ValidatorId<T>) -> bool {
let current_session = T::ValidatorSet::session_index();
ReceivedHeartbeats::<T>::contains_key(¤t_session, &authority_index) ||
AuthoredBlocks::<T>::get(¤t_session, authority) != 0
}
Every time in a session, this function returns true because of number of blocks authored is non-zero which prevents a heartbeat being sent. I speculate the heartbeats are never sent out from a node. Kindly someone help me better understand what exactly is happening here.