#NEWLINE# def recv_heartbeat( self , from_uid , proposal_id ) : #NEWLINE# #INDENT# if ( proposal_id > self . leader_proposal_id ) : #NEWLINE# #INDENT# self . _acquiring = False #NEWLINE# old_leader_uid = self . leader_uid #NEWLINE# self . leader_uid = from_uid #NEWLINE# self . leader_proposal_id = proposal_id #NEWLINE# if ( self . leader and ( proposal_id != self . node_uid ) ) : #NEWLINE# #INDENT# self . leader = False #NEWLINE# self . messenger . on_leadership_lost ( ) #NEWLINE# self . observe_proposal ( from_uid , proposal_id ) #NEWLINE# #UNINDENT# self . messenger . on_leadership_change ( old_leader_uid , from_uid ) #NEWLINE# #UNINDENT# if ( self . leader_proposal_id == proposal_id ) : #NEWLINE# #INDENT# self . _tlast_hb = self . timestamp ( )