The code assumes that check_rollovers_and_update_eid(...) is called every second, and that m_security_slot[slot_no].timing increases monotonically with 1. If this is not the case, one might miss out on the check where EID is updated, and you will have a stale EID until next wrap-around.