Fix Subscribe RPC to correctly distinguish bids and asks.

This commit is contained in:
Tom Ritchford
2015-01-02 14:54:35 -05:00
committed by Vinnie Falco
parent 799d9a73e6
commit cca5421aed
2 changed files with 7 additions and 1 deletions

View File

@@ -94,6 +94,12 @@ void hash_append (Hasher& h, BookType<ByValue> const& b)
hash_append (h, b.in, b.out);
}
template <bool ByValue>
BookType<ByValue> reversed (BookType<ByValue> const& book)
{
return BookType<ByValue> (book.out, book.in);
}
/** Ordered comparison. */
template <bool LhsByValue, bool RhsByValue>
int compare (BookType <LhsByValue> const& lhs,

View File

@@ -322,7 +322,7 @@ Json::Value doSubscribe (RPC::Context& context)
context.netOps.getBookPage (
context.role == Role::ADMIN,
lpLedger, book, raTakerID.getAccountID (),
lpLedger, reverse (book), raTakerID.getAccountID (),
false, 0, jvMarker, jvAsks);
if (jvAsks.isMember (jss::offers))