func (s *PeerState) UpdateState(state *protocol.TMStatusChange) { s.mu.Lock() s.CurrentLedger = state.GetLedgerSeq() s.MinLedger = state.GetFirstSeq() s.MaxLedger = state.GetLastSeq() s.Event = state.GetNewEvent().String() s.NodeStatus = state.GetNewStatus().String() s.mu.Unlock() }
func (p *Peer) handleStatusChange(state *protocol.TMStatusChange) { p.UpdateState(state) p.sync.Current(state.GetLedgerSeq()) }