Skip to content
This repository has been archived by the owner on Sep 2, 2023. It is now read-only.

Commit

Permalink
[FIX] Check order flags correctly (RLJS-279)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Cohen committed Mar 20, 2015
1 parent 0c24dfb commit 04c2614
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions api/orders.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ function getOrders(request, response, next) {
function getParsedOrders(offers) {
return _.reduce(offers, function(orders, off) {
var sequence = off.seq;
var passive = off.flags === ripple.Remote.flags.offer.Passive;
var type = off.flags === ripple.Remote.flags.offer.Sell ? 'sell' : 'buy'
var type = off.flags & ripple.Remote.flags.offer.Sell ? 'sell' : 'buy';
var passive = (off.flags & ripple.Remote.flags.offer.Passive) !== 0;

var taker_gets = utils.parseCurrencyAmount(off.taker_gets);
var taker_pays = utils.parseCurrencyAmount(off.taker_pays);
Expand Down Expand Up @@ -449,8 +449,8 @@ function getOrderBook(request, response, next) {
var sequence = off.Sequence;

// Transaction Flags
var passive = off.Flags === ripple.Remote.flags.offer.Passive;
var sell = off.Flags === ripple.Remote.flags.offer.Sell;
var passive = (off.Flags & ripple.Remote.flags.offer.Passive) !== 0;
var sell = (off.Flags & ripple.Remote.flags.offer.Sell) !==0;

var taker_gets_total = utils.parseCurrencyAmount(off.TakerGets);
var taker_gets_funded = off.taker_gets_funded ? utils.parseCurrencyAmount(off.taker_gets_funded) : taker_gets_total;
Expand Down

0 comments on commit 04c2614

Please sign in to comment.