mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-26 05:55:51 +00:00
Augment book_offers with quality.
This commit is contained in:
@@ -1972,8 +1972,8 @@ void NetworkOPs::getBookPage(Ledger::pointer lpLedger, const uint160& uTakerPays
|
|||||||
// Only provide, if not fully funded.
|
// Only provide, if not fully funded.
|
||||||
jvOffer["taker_gets_funded"] = saTakerGetsFunded.getJson(0);
|
jvOffer["taker_gets_funded"] = saTakerGetsFunded.getJson(0);
|
||||||
jvOffer["taker_pays_funded"] = saTakerPaysFunded.getJson(0);
|
jvOffer["taker_pays_funded"] = saTakerPaysFunded.getJson(0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
STAmount saOwnerPays = QUALITY_ONE == uOfferRate
|
STAmount saOwnerPays = QUALITY_ONE == uOfferRate
|
||||||
? saTakerGetsFunded
|
? saTakerGetsFunded
|
||||||
: std::min(saOwnerFunds, STAmount::multiply(saTakerGetsFunded, STAmount(CURRENCY_ONE, ACCOUNT_ONE, uOfferRate, -9)));
|
: 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)
|
if (!saOwnerFunds.isZero() || uOfferOwnerID == uTakerID)
|
||||||
{
|
{
|
||||||
// Only provide funded offers and offers of the taker.
|
// Only provide funded offers and offers of the taker.
|
||||||
|
jvOffer["quality"] = saDirRate.getText();
|
||||||
|
|
||||||
jvOffers.append(jvOffer);
|
jvOffers.append(jvOffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user