Beispiel #1
0
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()
}
Beispiel #2
0
func (p *Peer) handleStatusChange(state *protocol.TMStatusChange) {
	p.UpdateState(state)
	p.sync.Current(state.GetLedgerSeq())
}