コード例 #1
0
ファイル: commitEntry.go プロジェクト: jjdevbiz/factomd
func (m *CommitEntryMsg) FollowerExecute(state interfaces.IState) error {
	acks := state.GetAcks()
	ack, ok := acks[m.GetHash().Fixed()].(*Ack)
	if !ok || ack == nil {
		state.GetHolding()[m.GetHash().Fixed()] = m
	} else {
		processlist := state.GetProcessList()[ack.ServerIndex]
		for len(processlist) < ack.Height+1 {
			processlist = append(processlist, nil)
		}
		processlist[ack.Height] = m
		state.GetProcessList()[ack.ServerIndex] = processlist
		delete(acks, m.GetHash().Fixed())
	}

	return nil
}
コード例 #2
0
ファイル: ack.go プロジェクト: jjdevbiz/factomd
func (m *Ack) FollowerExecute(state interfaces.IState) error {
	acks := state.GetAcks()
	holding := state.GetHolding()
	msg := holding[m.MessageHash.Fixed()]
	if msg == nil {
		acks[m.GetHash().Fixed()] = m
	} else {
		processlist := state.GetProcessList()[m.ServerIndex]
		for len(processlist) < m.Height+1 {
			processlist = append(processlist, nil)
		}
		processlist[m.Height] = msg
		state.GetProcessList()[m.ServerIndex] = processlist
		delete(holding, m.MessageHash.Fixed())
	}

	state.UpdateProcessLists()

	return nil
}