Skip to content

Commit

Permalink
Fix script hang when orders Buys or Sells…
Browse files Browse the repository at this point in the history
Change /lib/markets/*.js to fix script hang when orders Buys or Sells…
  • Loading branch information
rudy4682 committed Nov 12, 2015
1 parent 77b06a0 commit 7b14560
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/markets/cryptsy.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ function get_orders(coin, exchange, Crymktid, cb) {
var orders = body.data;
var buys = [];
var sells = [];
if (orders['Buy'].length > 0){
for (var i = 0; i < orders['buyorders['].length; i++) {
if (orders['buyorders'].length > 0){
for (var i = 0; i < orders['buyorders'].length; i++) {
var order = {
amount: parseFloat(orders.buyorders[i].quantity).toFixed(8),
price: parseFloat(orders.buyorders[i].price).toFixed(8),
Expand All @@ -58,7 +58,7 @@ function get_orders(coin, exchange, Crymktid, cb) {
buys.push(order);
}
} else {}
if (orders['Sell'].length > 0) {
if (orders['sellorders'].length > 0) {
for (var x = 0; x < orders['sellorders'].length; x++) {
var order = {
amount: parseFloat(orders.sellorders[x].quantity).toFixed(8),
Expand Down

0 comments on commit 7b14560

Please sign in to comment.