示例#1
0
文件: state.go 项目: Zoramite/ripple
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()
}
示例#2
0
文件: peer.go 项目: Zoramite/ripple
func (p *Peer) handleStatusChange(state *protocol.TMStatusChange) {
	p.UpdateState(state)
	p.sync.Current(state.GetLedgerSeq())
}