func (db *CXDBMemory) ViewAuctionOrderBook(tradingPair *match.Pair, auctionID [32]byte) (sellOrderBook []*match.AuctionOrder, buyOrderBook []*match.AuctionOrder, err error) {

	db.ordersMtx.Lock()
	var allOrders []*match.AuctionOrder
	var ok bool
	if allOrders, ok = db.orders[auctionID]; !ok {
		db.ordersMtx.Unlock()
		err = fmt.Errorf("Could not find auctionID in the auction orderbook")
		return
	}
	for _, order := range allOrders {
		if order.TradingPair == *tradingPair {
			if order.IsBuySide() {
				buyOrderBook = append(buyOrderBook, order)
			} else if order.IsSellSide() {
				sellOrderBook = append(sellOrderBook, order)
			}
		}
	}

	db.ordersMtx.Unlock()
	return
}
// ViewAuctionOrderBook takes in a trading pair and auction ID, and returns auction orders.
ViewAuctionOrderBook takes in a trading pair and auction ID, and returns auction orders.
// ViewAuctionOrderBook takes in a trading pair and auction ID and returns auction orders .
func (db *CXDBMemory) ViewAuctionOrderBook(tradingPair *match.Pair, auctionID [32]byte) (sellOrderBook []*match.AuctionOrder, buyOrderBook []*match.AuctionOrder, err error) {
	db.ordersMtx.Lock()
	var allOrders []*match.AuctionOrder
	var ok bool
	if allOrders, ok = db.orders[auctionID]; !ok {
		db.ordersMtx.Unlock()
		err = fmt.Errorf("Could not find auctionID in the auction orderbook")
		return
	}
	for _, order := range allOrders {
		if order.TradingPair == *tradingPair {
			if order.IsBuySide() {
				buyOrderBook = append(buyOrderBook, order)
			} else if order.IsSellSide() {
				sellOrderBook = append(sellOrderBook, order)
			}
		}
	}
	db.ordersMtx.Unlock()
	return
}
func ( db * CXDBMemory ) ViewAuctionOrderBook ( tradingPair * match . Pair , auctionID [ 32 ] byte ) ( sellOrderBook [ ] * match . AuctionOrder , buyOrderBook [ ] * match . AuctionOrder , err error ) { db . ordersMtx . Lock ( ) var allOrders [ ] * match . AuctionOrder var ok bool if allOrders , ok = db . orders [ auctionID ] ; ! ok { db . ordersMtx . Unlock ( ) err = fmt . Errorf ( " " ) return } for _ , order := range allOrders { if order . TradingPair == * tradingPair { if order . IsBuySide ( ) { buyOrderBook = append ( buyOrderBook , order ) } else if order . IsSellSide ( ) { sellOrderBook = append ( sellOrderBook , order ) } } } db . ordersMtx . Unlock ( ) return }
ViewAuctionOrderBook takes in a trading pair and auction ID, and returns auction orders.
ViewAuctionOrderBook takes in a trading pair and auction ID and returns auction orders .