3#include <xrpld/app/main/Application.h>
4#include <xrpld/rpc/detail/AssetCache.h>
6#include <xrpl/basics/CountedObject.h>
7#include <xrpl/core/LoadEvent.h>
8#include <xrpl/ledger/Ledger.h>
9#include <xrpl/protocol/PathAsset.h>
10#include <xrpl/protocol/STAmount.h>
11#include <xrpl/protocol/STPathSet.h>
58 STPath& fullLiquidityPath,
59 STPathSet
const& extraPaths,
126 bool isDestPathAsset,
132 STPath const& currentPath,
153 uint64_t& qualityOut)
const;
A generic endpoint for log messages.
static std::uint32_t const kAfObLast
void addLinks(STPathSet const ¤tPaths, STPathSet &incompletePaths, int addFlags, std::function< bool(void)> const &continueCallback)
void rankPaths(int maxPaths, STPathSet const &paths, std::vector< PathRank > &rankedPaths, std::function< bool(void)> const &continueCallback)
TER getPathLiquidity(STPath const &path, STAmount const &minDstAmount, STAmount &amountOut, uint64_t &qualityOut) const
Pathfinder(std::shared_ptr< AssetCache > const &cache, AccountID const &srcAccount, AccountID const &dstAccount, PathAsset const &uSrcPathAsset, std::optional< AccountID > const &uSrcIssuer, STAmount const &dstAmount, std::optional< STAmount > const &srcAmount, std::optional< uint256 > const &domain, Application &app)
Construct a pathfinder without an issuer.
hash_map< Asset, int > pathsOutCountMap_
bool issueMatchesOrigin(Asset const &)
static std::uint32_t const kAfAddAccounts
STPathSet getBestPaths(int maxPaths, STPath &fullLiquidityPath, STPathSet const &extraPaths, AccountID const &srcIssuer, std::function< bool(void)> const &continueCallback={})
void addLink(STPath const ¤tPath, STPathSet &incompletePaths, int addFlags, std::function< bool(void)> const &continueCallback)
std::vector< NodeType > PathType
std::unique_ptr< LoadEvent > loadEvent_
Pathfinder(Pathfinder const &)=delete
static std::uint32_t const kAfObXrp
std::optional< AccountID > srcIssuer_
std::map< PathType, STPathSet > paths_
std::optional< uint256 > domain_
static std::uint32_t const kAfAcLast
std::shared_ptr< AssetCache > rLCache_
STPathSet & addPathsForType(PathType const &type, std::function< bool(void)> const &continueCallback)
bool isNoRipple(AccountID const &fromAccount, AccountID const &toAccount, Currency const ¤cy)
bool findPaths(int searchLevel, std::function< bool(void)> const &continueCallback={})
bool isNoRippleOut(STPath const ¤tPath)
static void initPathTable()
STAmount remainingAmount_
The amount remaining from srcAccount_ after the default liquidity has been removed.
static std::uint32_t const kAfAddBooks
Pathfinder & operator=(Pathfinder const &)=delete
int getPathsOut(PathAsset const &pathAsset, AccountID const &account, LineDirection direction, bool isDestPathAsset, AccountID const &dest, std::function< bool(void)> const &continueCallback)
std::vector< PathRank > pathRanks_
std::shared_ptr< ReadView const > ledger_
void computePathRanks(int maxPaths, std::function< bool(void)> const &continueCallback={})
Compute the rankings of the paths.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
BaseUInt< 160, detail::CurrencyTag > Currency
Currency is a hash representing a specific currency.
LineDirection
Describes how an account was found in a path, and how to find the next set of paths.
std::unordered_map< Key, Value, Hash, Pred, Allocator > hash_map
BaseUInt< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
TERSubset< CanCvtToTER > TER