mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-23 05:05:54 +00:00
@@ -86,6 +86,32 @@ LedgerHandler::process(LedgerHandler::Input input, Context const& ctx) const
|
||||
entry[JS(meta)] = ripple::strHex(obj.metadata);
|
||||
}
|
||||
|
||||
if (input.ownerFunds)
|
||||
{
|
||||
// check the type of tx
|
||||
auto const [tx, meta] = RPC::deserializeTxPlusMeta(obj);
|
||||
if (tx and tx->isFieldPresent(ripple::sfTransactionType) and
|
||||
tx->getTxnType() == ripple::ttOFFER_CREATE)
|
||||
{
|
||||
auto const account = tx->getAccountID(ripple::sfAccount);
|
||||
auto const amount = tx->getFieldAmount(ripple::sfTakerGets);
|
||||
|
||||
// If the offer create is not self funded then add the
|
||||
// owner balance
|
||||
if (account != amount.getIssuer())
|
||||
{
|
||||
auto const ownerFunds = accountHolds(
|
||||
*sharedPtrBackend_,
|
||||
lgrInfo.seq,
|
||||
account,
|
||||
amount.getCurrency(),
|
||||
amount.getIssuer(),
|
||||
false, // fhIGNORE_FREEZE from rippled
|
||||
ctx.yield);
|
||||
entry[JS(owner_funds)] = ownerFunds.getText();
|
||||
}
|
||||
}
|
||||
}
|
||||
return entry;
|
||||
});
|
||||
}
|
||||
@@ -173,6 +199,9 @@ tag_invoke(boost::json::value_to_tag<LedgerHandler::Input>, boost::json::value c
|
||||
if (jsonObject.contains(JS(expand)))
|
||||
input.expand = jv.at(JS(expand)).as_bool();
|
||||
|
||||
if (jsonObject.contains(JS(owner_funds)))
|
||||
input.ownerFunds = jv.at(JS(owner_funds)).as_bool();
|
||||
|
||||
if (jsonObject.contains("diff"))
|
||||
input.diff = jv.at("diff").as_bool();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user