diff --git a/src/ripple/protocol/Book.h b/src/ripple/protocol/Book.h index 3a095c4f1..86ba29d5b 100644 --- a/src/ripple/protocol/Book.h +++ b/src/ripple/protocol/Book.h @@ -94,6 +94,12 @@ void hash_append (Hasher& h, BookType const& b) hash_append (h, b.in, b.out); } +template +BookType reversed (BookType const& book) +{ + return BookType (book.out, book.in); +} + /** Ordered comparison. */ template int compare (BookType const& lhs, diff --git a/src/ripple/rpc/handlers/Subscribe.cpp b/src/ripple/rpc/handlers/Subscribe.cpp index 549fcab70..3cf2aa5b4 100644 --- a/src/ripple/rpc/handlers/Subscribe.cpp +++ b/src/ripple/rpc/handlers/Subscribe.cpp @@ -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))