From bf885cddc0801b9072d1f290f5ce85609ef74ede Mon Sep 17 00:00:00 2001 From: Ryan O'Hara-Reid Date: Mon, 11 Jun 2018 11:49:40 +1000 Subject: [PATCH] Fixed bug in Binance GetOrderbook. --- exchanges/binance/binance.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/exchanges/binance/binance.go b/exchanges/binance/binance.go index 2d287676..cb35f2bc 100644 --- a/exchanges/binance/binance.go +++ b/exchanges/binance/binance.go @@ -161,8 +161,9 @@ func (b *Binance) GetOrderBook(symbol string, limit int64) (OrderBook, error) { ASK.Price, _ = strconv.ParseFloat(ask.(string), 64) case 1: ASK.Quantity, _ = strconv.ParseFloat(ask.(string), 64) + orderbook.Asks = append(orderbook.Asks, ASK) + break } - orderbook.Asks = append(orderbook.Asks, ASK) } } @@ -177,8 +178,9 @@ func (b *Binance) GetOrderBook(symbol string, limit int64) (OrderBook, error) { BID.Price, _ = strconv.ParseFloat(bid.(string), 64) case 1: BID.Quantity, _ = strconv.ParseFloat(bid.(string), 64) + orderbook.Bids = append(orderbook.Bids, BID) + break } - orderbook.Bids = append(orderbook.Bids, BID) } } return orderbook, nil