diff --git a/chapter05/nockmarket.js b/chapter05/nockmarket.js index 5c7abad..38d232b 100644 --- a/chapter05/nockmarket.js +++ b/chapter05/nockmarket.js @@ -26,12 +26,13 @@ function submitRandomOrder(index) { db.insertOne('transactions', ord, function(err, order) { if (exchangeData.trades && exchangeData.trades.length > 0) { - nocklib.sendTrades(exchangeData.trades); + //nocklib.sendTrades(exchangeData.trades); var trades = exchangeData.trades.map(function(trade) { trade.init = (ord.type == exch.BUY) ? 'b' : 's'; trade.stock = stocks[index]; return trade; }); + nocklib.sendTrades(trades); db.insert('transactions', trades, function(err, trades) { pauseThenTrade(); });