1#ifndef XRPL_APP_PATHS_PATHFINDER_H_INCLUDED
2#define XRPL_APP_PATHS_PATHFINDER_H_INCLUDED
4#include <xrpld/app/ledger/Ledger.h>
5#include <xrpld/app/paths/RippleLineCache.h>
6#include <xrpld/core/LoadEvent.h>
8#include <xrpl/basics/CountedObject.h>
9#include <xrpl/protocol/STAmount.h>
10#include <xrpl/protocol/STPathSet.h>
61 STPath& fullLiquidityPath,
62 STPathSet
const& extraPaths,
137 STPath const& currentPath,
158 uint64_t& qualityOut)
const;
A generic endpoint for log messages.
Tracks the number of instances of an object.
A currency issued by an account.
Calculates payment paths.
bool issueMatchesOrigin(Issue const &)
void rankPaths(int maxPaths, STPathSet const &paths, std::vector< PathRank > &rankedPaths, std::function< bool(void)> const &continueCallback)
bool findPaths(int searchLevel, std::function< bool(void)> const &continueCallback={})
std::optional< AccountID > mSrcIssuer
std::unique_ptr< LoadEvent > m_loadEvent
Pathfinder & operator=(Pathfinder const &)=delete
std::shared_ptr< RippleLineCache > mRLCache
TER getPathLiquidity(STPath const &path, STAmount const &minDstAmount, STAmount &amountOut, uint64_t &qualityOut) const
std::map< PathType, STPathSet > mPaths
static std::uint32_t const afADD_ACCOUNTS
void computePathRanks(int maxPaths, std::function< bool(void)> const &continueCallback={})
Compute the rankings of the paths.
STAmount mRemainingAmount
The amount remaining from mSrcAccount after the default liquidity has been removed.
bool isNoRippleOut(STPath const ¤tPath)
void addLinks(STPathSet const ¤tPaths, STPathSet &incompletePaths, int addFlags, std::function< bool(void)> const &continueCallback)
static std::uint32_t const afADD_BOOKS
int getPathsOut(Currency const ¤cy, AccountID const &account, LineDirection direction, bool isDestCurrency, AccountID const &dest, std::function< bool(void)> const &continueCallback)
Pathfinder(Pathfinder const &)=delete
bool isNoRipple(AccountID const &fromAccount, AccountID const &toAccount, Currency const ¤cy)
STPathSet & addPathsForType(PathType const &type, std::function< bool(void)> const &continueCallback)
static std::uint32_t const afOB_XRP
static void initPathTable()
hash_map< Issue, int > mPathsOutCountMap
std::vector< PathRank > mPathRanks
std::optional< uint256 > mDomain
void addLink(STPath const ¤tPath, STPathSet &incompletePaths, int addFlags, std::function< bool(void)> const &continueCallback)
STPathSet getBestPaths(int maxPaths, STPath &fullLiquidityPath, STPathSet const &extraPaths, AccountID const &srcIssuer, std::function< bool(void)> const &continueCallback={})
static std::uint32_t const afAC_LAST
std::shared_ptr< ReadView const > mLedger
static std::uint32_t const afOB_LAST
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
base_uint< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
LineDirection
Describes how an account was found in a path, and how to find the next set of paths.