コード例 #1
0
ファイル: eom.go プロジェクト: jjdevbiz/factomd
func (m *EOM) FollowerExecute(state interfaces.IState) error {

	state.GetFactoidState().EndOfPeriod(int(m.Minute))

	switch state.GetNetworkNumber() {
	case constants.NETWORK_MAIN: // Main Network
		panic("Not implemented yet")
	case constants.NETWORK_TEST: // Test Network
		panic("Not implemented yet")
	case constants.NETWORK_LOCAL: // Local Network

	default:
		panic(fmt.Sprintf("Not implemented yet: Network Number %d", state.GetNetworkNumber()))
	}

	// fmt.Println(state.GetServerState(), constants.SERVER_MODE)

	if m.Minute == 9 {
		state.ProcessEndOfBlock()
		if state.GetServerState() == constants.SERVER_MODE {
			state.LeaderInMsgQueue() <- m
		}
	}

	return nil
}