From a0dc6184e308d3886c44bd65c9d95d5120a067b8 Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Sun, 21 Apr 2013 11:06:57 -0700 Subject: [PATCH] Augment book_offers with quality. --- src/cpp/ripple/NetworkOPs.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cpp/ripple/NetworkOPs.cpp b/src/cpp/ripple/NetworkOPs.cpp index 600e39f6b..1416fd3b1 100644 --- a/src/cpp/ripple/NetworkOPs.cpp +++ b/src/cpp/ripple/NetworkOPs.cpp @@ -1972,8 +1972,8 @@ void NetworkOPs::getBookPage(Ledger::pointer lpLedger, const uint160& uTakerPays // Only provide, if not fully funded. jvOffer["taker_gets_funded"] = saTakerGetsFunded.getJson(0); jvOffer["taker_pays_funded"] = saTakerPaysFunded.getJson(0); - } + STAmount saOwnerPays = QUALITY_ONE == uOfferRate ? saTakerGetsFunded : std::min(saOwnerFunds, STAmount::multiply(saTakerGetsFunded, STAmount(CURRENCY_ONE, ACCOUNT_ONE, uOfferRate, -9))); @@ -1985,6 +1985,8 @@ void NetworkOPs::getBookPage(Ledger::pointer lpLedger, const uint160& uTakerPays if (!saOwnerFunds.isZero() || uOfferOwnerID == uTakerID) { // Only provide funded offers and offers of the taker. + jvOffer["quality"] = saDirRate.getText(); + jvOffers.append(jvOffer); }