20 #ifndef RIPPLE_APP_PATHS_PATHFINDER_H_INCLUDED
21 #define RIPPLE_APP_PATHS_PATHFINDER_H_INCLUDED
23 #include <ripple/app/ledger/Ledger.h>
24 #include <ripple/app/paths/RippleLineCache.h>
25 #include <ripple/core/LoadEvent.h>
26 #include <ripple/protocol/STAmount.h>
27 #include <ripple/protocol/STPathSet.h>
46 boost::optional<AccountID>
const& uSrcIssuer,
48 boost::optional<STAmount>
const& srcAmount,
144 STPath const& currentPath,
163 uint64_t& qualityOut)
const;
A currency issued by an account.
static const std::uint32_t afADD_ACCOUNTS
Calculates payment paths.
static const std::uint32_t afOB_LAST
std::map< PathType, STPathSet > mPaths
bool findPaths(int searchLevel)
static void initPathTable()
Pathfinder(std::shared_ptr< RippleLineCache > const &cache, AccountID const &srcAccount, AccountID const &dstAccount, Currency const &uSrcCurrency, boost::optional< AccountID > const &uSrcIssuer, STAmount const &dstAmount, boost::optional< STAmount > const &srcAmount, Application &app)
Construct a pathfinder without an issuer.
bool isNoRipple(AccountID const &fromAccount, AccountID const &toAccount, Currency const ¤cy)
TER getPathLiquidity(STPath const &path, STAmount const &minDstAmount, STAmount &amountOut, uint64_t &qualityOut) const
static const std::uint32_t afAC_LAST
STPathSet getBestPaths(int maxPaths, STPath &fullLiquidityPath, STPathSet const &extraPaths, AccountID const &srcIssuer)
Pathfinder & operator=(Pathfinder const &)=delete
void computePathRanks(int maxPaths)
Compute the rankings of the paths.
STPathSet & addPathsForType(PathType const &type)
void addLinks(STPathSet const ¤tPaths, STPathSet &incompletePaths, int addFlags)
std::shared_ptr< ReadView const > mLedger
void rankPaths(int maxPaths, STPathSet const &paths, std::vector< PathRank > &rankedPaths)
std::shared_ptr< RippleLineCache > mRLCache
void addLink(STPath const ¤tPath, STPathSet &incompletePaths, int addFlags)
A generic endpoint for log messages.
std::unique_ptr< LoadEvent > m_loadEvent
STAmount mRemainingAmount
The amount remaining from mSrcAccount after the default liquidity has been removed.
int getPathsOut(Currency const ¤cy, AccountID const &account, bool isDestCurrency, AccountID const &dest)
boost::optional< AccountID > mSrcIssuer
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
static const std::uint32_t afOB_XRP
bool issueMatchesOrigin(Issue const &)
static const std::uint32_t afADD_BOOKS
bool isNoRippleOut(STPath const ¤tPath)
hash_map< Issue, int > mPathsOutCountMap
std::vector< PathRank > mPathRanks