|
xrpld
|
Calculates payment paths. More...
#include <Pathfinder.h>


Classes | |
| struct | PathRank |
Public Types | |
| enum class | NodeType { Source , Accounts , Books , XrpBook , DestBook , Destination } |
| enum class | PaymentType { XrpToXrp , XrpToNonXrp , NonXrpToXrp , NonXrpToSame , NonXrpToNonXrp } |
| using | PathType = std::vector<NodeType> |
Public Member Functions | |
| 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. | |
| Pathfinder (Pathfinder const &)=delete | |
| Pathfinder & | operator= (Pathfinder const &)=delete |
| ~Pathfinder ()=default | |
| bool | findPaths (int searchLevel, std::function< bool(void)> const &continueCallback={}) |
| void | computePathRanks (int maxPaths, std::function< bool(void)> const &continueCallback={}) |
| Compute the rankings of the paths. | |
| STPathSet | getBestPaths (int maxPaths, STPath &fullLiquidityPath, STPathSet const &extraPaths, AccountID const &srcIssuer, std::function< bool(void)> const &continueCallback={}) |
Static Public Member Functions | |
| static void | initPathTable () |
Public Attributes | |
| friend | Object |
Private Member Functions | |
| STPathSet & | addPathsForType (PathType const &type, std::function< bool(void)> const &continueCallback) |
| bool | issueMatchesOrigin (Asset const &) |
| int | getPathsOut (PathAsset const &pathAsset, AccountID const &account, LineDirection direction, bool isDestPathAsset, AccountID const &dest, std::function< bool(void)> const &continueCallback) |
| void | addLink (STPath const ¤tPath, STPathSet &incompletePaths, int addFlags, std::function< bool(void)> const &continueCallback) |
| void | addLinks (STPathSet const ¤tPaths, STPathSet &incompletePaths, int addFlags, std::function< bool(void)> const &continueCallback) |
| TER | getPathLiquidity (STPath const &path, STAmount const &minDstAmount, STAmount &amountOut, uint64_t &qualityOut) const |
| bool | isNoRippleOut (STPath const ¤tPath) |
| bool | isNoRipple (AccountID const &fromAccount, AccountID const &toAccount, Currency const ¤cy) |
| void | rankPaths (int maxPaths, STPathSet const &paths, std::vector< PathRank > &rankedPaths, std::function< bool(void)> const &continueCallback) |
Static Private Member Functions | |
| static auto & | getCounter () noexcept |
Private Attributes | |
| AccountID | srcAccount_ |
| AccountID | dstAccount_ |
| AccountID | effectiveDst_ |
| STAmount | dstAmount_ |
| PathAsset | srcPathAsset_ |
| std::optional< AccountID > | srcIssuer_ |
| STAmount | srcAmount_ |
| STAmount | remainingAmount_ |
| The amount remaining from srcAccount_ after the default liquidity has been removed. | |
| bool | convertAll_ |
| std::optional< uint256 > | domain_ |
| std::shared_ptr< ReadView const > | ledger_ |
| std::unique_ptr< LoadEvent > | loadEvent_ |
| std::shared_ptr< AssetCache > | rLCache_ |
| STPathElement | source_ |
| STPathSet | completePaths_ |
| std::vector< PathRank > | pathRanks_ |
| std::map< PathType, STPathSet > | paths_ |
| hash_map< Asset, int > | pathsOutCountMap_ |
| Application & | app_ |
| beast::Journal const | j_ |
Static Private Attributes | |
| static std::uint32_t const | kAfAddAccounts = 0x001 |
| static std::uint32_t const | kAfAddBooks = 0x002 |
| static std::uint32_t const | kAfObXrp = 0x010 |
| static std::uint32_t const | kAfObLast = 0x040 |
| static std::uint32_t const | kAfAcLast = 0x080 |
Calculates payment paths.
The RippleCalc determines the quality of the found paths.
Definition at line 21 of file Pathfinder.h.
Definition at line 73 of file Pathfinder.h.
|
strong |
| Enumerator | |
|---|---|
| Source | |
| Accounts | |
| Books | |
| XrpBook | |
| DestBook | |
| Destination | |
Definition at line 63 of file Pathfinder.h.
|
strong |
| Enumerator | |
|---|---|
| XrpToXrp | |
| XrpToNonXrp | |
| NonXrpToXrp | |
| NonXrpToSame | |
| NonXrpToNonXrp | |
Definition at line 77 of file Pathfinder.h.
| xrpl::Pathfinder::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.
Definition at line 211 of file Pathfinder.cpp.
|
delete |
|
default |
|
delete |
|
static |
Definition at line 1371 of file Pathfinder.cpp.
| bool xrpl::Pathfinder::findPaths | ( | int | searchLevel, |
| std::function< bool(void)> const & | continueCallback = {} ) |
Definition at line 241 of file Pathfinder.cpp.
| void xrpl::Pathfinder::computePathRanks | ( | int | maxPaths, |
| std::function< bool(void)> const & | continueCallback = {} ) |
Compute the rankings of the paths.
Definition at line 451 of file Pathfinder.cpp.
| STPathSet xrpl::Pathfinder::getBestPaths | ( | int | maxPaths, |
| STPath & | fullLiquidityPath, | ||
| STPathSet const & | extraPaths, | ||
| AccountID const & | srcIssuer, | ||
| std::function< bool(void)> const & | continueCallback = {} ) |
Definition at line 604 of file Pathfinder.cpp.
|
private |
Definition at line 854 of file Pathfinder.cpp.
|
private |
Definition at line 738 of file Pathfinder.cpp.
|
private |
Definition at line 748 of file Pathfinder.cpp.
|
private |
Definition at line 976 of file Pathfinder.cpp.
|
private |
Definition at line 838 of file Pathfinder.cpp.
|
private |
Definition at line 382 of file Pathfinder.cpp.
|
private |
Definition at line 942 of file Pathfinder.cpp.
|
private |
Definition at line 927 of file Pathfinder.cpp.
|
private |
Definition at line 526 of file Pathfinder.cpp.
|
staticprivatenoexceptinherited |
Definition at line 109 of file CountedObject.h.
|
private |
Definition at line 171 of file Pathfinder.h.
|
private |
Definition at line 172 of file Pathfinder.h.
|
private |
Definition at line 173 of file Pathfinder.h.
|
private |
Definition at line 174 of file Pathfinder.h.
|
private |
Definition at line 175 of file Pathfinder.h.
|
private |
Definition at line 176 of file Pathfinder.h.
|
private |
Definition at line 177 of file Pathfinder.h.
|
private |
The amount remaining from srcAccount_ after the default liquidity has been removed.
Definition at line 180 of file Pathfinder.h.
|
private |
Definition at line 181 of file Pathfinder.h.
|
private |
Definition at line 182 of file Pathfinder.h.
|
private |
Definition at line 184 of file Pathfinder.h.
|
private |
Definition at line 185 of file Pathfinder.h.
|
private |
Definition at line 186 of file Pathfinder.h.
|
private |
Definition at line 188 of file Pathfinder.h.
|
private |
Definition at line 189 of file Pathfinder.h.
|
private |
Definition at line 190 of file Pathfinder.h.
Definition at line 191 of file Pathfinder.h.
Definition at line 193 of file Pathfinder.h.
|
private |
Definition at line 195 of file Pathfinder.h.
|
private |
Definition at line 196 of file Pathfinder.h.
|
staticprivate |
Definition at line 199 of file Pathfinder.h.
|
staticprivate |
Definition at line 202 of file Pathfinder.h.
|
staticprivate |
Definition at line 205 of file Pathfinder.h.
|
staticprivate |
Definition at line 208 of file Pathfinder.h.
|
staticprivate |
Definition at line 211 of file Pathfinder.h.
|
inherited |
Definition at line 134 of file CountedObject.h.