func InitServer(db cxdb.OpencxAuctionStore, orderChanSize uint64, standardAuctionTime uint64) (server *OpencxAuctionServer, err error) {
	logging.Infof("Starting an auction with auction time %d", standardAuctionTime)
	server = &OpencxAuctionServer{
		OpencxDB:     db,
		dbLock:       new(sync.Mutex),
		orderChannel: make(chan *match.OrderPuzzleResult, orderChanSize),
		t:            standardAuctionTime,
	}

	// Set auctionID to something random
	if _, err = rand.Read(server.auctionID[:]); err != nil {
		err = fmt.Errorf("Error getting random auction ID for initializing server: %s", err)
		return
	}

	// Start the solved order handler (TODO: is this the right place to put this?)
	go server.AuctionOrderHandler(server.orderChannel)

	// Start the auction clock (also TODO: is this the right place to put this?)
	go server.AuctionClock()

	return
}
// InitServer creates a new server
InitServer creates a new server
// InitServer creates a new server
func InitServer(db cxdb.OpencxAuctionStore, orderChanSize uint64, standardAuctionTime uint64) (server *OpencxAuctionServer, err error) {
	logging.Infof("Starting an auction with auction time %d", standardAuctionTime)
	server = &OpencxAuctionServer{
		OpencxDB:     db,
		dbLock:       new(sync.Mutex),
		orderChannel: make(chan *match.OrderPuzzleResult, orderChanSize),
		t:            standardAuctionTime,
	}
	if _, err = rand.Read(server.auctionID[:]); err != nil {
		err = fmt.Errorf("Error getting random auction ID for initializing server: %s", err)
		return
	}
	go server.AuctionOrderHandler(server.orderChannel)
	go server.AuctionClock()
	return
}
func InitServer ( db cxdb . OpencxAuctionStore , orderChanSize uint64 , standardAuctionTime uint64 ) ( server * OpencxAuctionServer , err error ) { logging . Infof ( " " , standardAuctionTime ) server = & OpencxAuctionServer { OpencxDB : db , dbLock : new ( sync . Mutex ) , orderChannel : make ( chan * match . OrderPuzzleResult , orderChanSize ) , t : standardAuctionTime , } if _ , err = rand . Read ( server . auctionID [ : ] ) ; err != nil { err = fmt . Errorf ( " " , err ) return } go server . AuctionOrderHandler ( server . orderChannel ) go server . AuctionClock ( ) return }
InitServer creates a new server
InitServer creates a new server
// Set auctionID to something random // Start the solved order handler (TODO: is this the right place to put this?) // Start the auction clock (also TODO: is this the right place to put this?)