mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Return the "destination_currencies" field.
This commit is contained in:
@@ -714,7 +714,7 @@ boost::unordered_set<uint160> usAccountSourceCurrencies(const RippleAddress& raA
|
||||
BOOST_FOREACH(AccountItem::ref item, rippleLines.getItems())
|
||||
{
|
||||
RippleState* rspEntry = (RippleState*) item.get();
|
||||
STAmount saBalance = rspEntry->getBalance();
|
||||
const STAmount& saBalance = rspEntry->getBalance();
|
||||
|
||||
// Filter out non
|
||||
if (saBalance.isPositive() // Have IOUs to send.
|
||||
@@ -729,6 +729,30 @@ boost::unordered_set<uint160> usAccountSourceCurrencies(const RippleAddress& raA
|
||||
return usCurrencies;
|
||||
}
|
||||
|
||||
boost::unordered_set<uint160> usAccountDestCurrencies(const RippleAddress& raAccountID, Ledger::ref lrLedger,
|
||||
bool includeXRP)
|
||||
{
|
||||
boost::unordered_set<uint160> usCurrencies;
|
||||
|
||||
if (includeXRP)
|
||||
usCurrencies.insert(uint160(CURRENCY_XRP)); // Even if account doesn't exist
|
||||
|
||||
// List of ripple lines.
|
||||
AccountItems rippleLines(raAccountID.getAccountID(), lrLedger, AccountItem::pointer(new RippleState()));
|
||||
|
||||
BOOST_FOREACH(AccountItem::ref item, rippleLines.getItems())
|
||||
{
|
||||
RippleState* rspEntry = (RippleState*) item.get();
|
||||
const STAmount& saBalance = rspEntry->getBalance();
|
||||
|
||||
if (saBalance < rspEntry->getLimit()) // Can take more
|
||||
usCurrencies.insert(saBalance.getCurrency());
|
||||
}
|
||||
|
||||
usCurrencies.erase(CURRENCY_BAD);
|
||||
return usCurrencies;
|
||||
}
|
||||
|
||||
AccountItems& Pathfinder::getRippleLines(const uint160& accountID)
|
||||
{
|
||||
boost::unordered_map<uint160, AccountItems::pointer>::iterator it = mRLMap.find(accountID);
|
||||
|
||||
Reference in New Issue
Block a user