mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Fix Pathfinder::getPathsOut to use Issue
This commit is contained in:
committed by
Vinnie Falco
parent
c841f8b360
commit
e3698b2a07
@@ -490,16 +490,17 @@ int Pathfinder::getPathsOut (
|
||||
Currency const& currencyID, Account const& accountID,
|
||||
bool isDstCurrency, Account const& dstAccount)
|
||||
{
|
||||
auto currencyAccount = std::make_pair(currencyID, accountID);
|
||||
auto it = mPOMap.find (currencyAccount);
|
||||
Issue issue (currencyID, accountID);
|
||||
auto it = mPathsOutCountMap.find (issue);
|
||||
|
||||
if (it != mPOMap.end ())
|
||||
if (it != mPathsOutCountMap.end ())
|
||||
return it->second;
|
||||
|
||||
auto sleAccount = mLedger->getSLEi(Ledger::getAccountRootIndex(accountID));
|
||||
auto sleAccount = mLedger->getSLEi (
|
||||
Ledger::getAccountRootIndex (accountID));
|
||||
if (!sleAccount)
|
||||
{
|
||||
mPOMap[currencyAccount] = 0;
|
||||
mPathsOutCountMap[issue] = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -541,7 +542,7 @@ int Pathfinder::getPathsOut (
|
||||
++count;
|
||||
}
|
||||
}
|
||||
mPOMap[currencyAccount] = count;
|
||||
mPathsOutCountMap[issue] = count;
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
@@ -133,11 +133,11 @@ private:
|
||||
LoadEvent::pointer m_loadEvent;
|
||||
RippleLineCache::pointer mRLCache;
|
||||
|
||||
STPathElement mSource;
|
||||
STPathSet mCompletePaths;
|
||||
STPathElement mSource;
|
||||
STPathSet mCompletePaths;
|
||||
std::map<PathType_t, STPathSet> mPaths;
|
||||
|
||||
hash_map<std::pair<Currency, Account>, int> mPOMap;
|
||||
hash_map<Issue, int> mPathsOutCountMap;
|
||||
|
||||
// Add ripple paths
|
||||
static std::uint32_t const afADD_ACCOUNTS = 0x001;
|
||||
|
||||
Reference in New Issue
Block a user