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


Classes | |
| struct | PathRank |
Public Types | |
| enum | NodeType { nt_SOURCE , nt_ACCOUNTS , nt_BOOKS , nt_XRP_BOOK , nt_DEST_BOOK , nt_DESTINATION } |
| enum | PaymentType { pt_XRP_to_XRP , pt_XRP_to_nonXRP , pt_nonXRP_to_XRP , pt_nonXRP_to_same , pt_nonXRP_to_nonXRP } |
| using | PathType = std::vector< NodeType > |
Public Member Functions | |
| Pathfinder (std::shared_ptr< RippleLineCache > const &cache, AccountID const &srcAccount, AccountID const &dstAccount, Currency const &uSrcCurrency, 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 () |
Private Member Functions | |
| STPathSet & | addPathsForType (PathType const &type, std::function< bool(void)> const &continueCallback) |
| bool | issueMatchesOrigin (Issue const &) |
| int | getPathsOut (Currency const ¤cy, AccountID const &account, LineDirection direction, bool isDestCurrency, 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 | mSrcAccount |
| AccountID | mDstAccount |
| AccountID | mEffectiveDst |
| STAmount | mDstAmount |
| Currency | mSrcCurrency |
| std::optional< AccountID > | mSrcIssuer |
| STAmount | mSrcAmount |
| STAmount | mRemainingAmount |
| The amount remaining from mSrcAccount after the default liquidity has been removed. | |
| bool | convert_all_ |
| std::optional< uint256 > | mDomain |
| std::shared_ptr< ReadView const > | mLedger |
| std::unique_ptr< LoadEvent > | m_loadEvent |
| std::shared_ptr< RippleLineCache > | mRLCache |
| STPathElement | mSource |
| STPathSet | mCompletePaths |
| std::vector< PathRank > | mPathRanks |
| std::map< PathType, STPathSet > | mPaths |
| hash_map< Issue, int > | mPathsOutCountMap |
| Application & | app_ |
| beast::Journal const | j_ |
Static Private Attributes | |
| static std::uint32_t const | afADD_ACCOUNTS = 0x001 |
| static std::uint32_t const | afADD_BOOKS = 0x002 |
| static std::uint32_t const | afOB_XRP = 0x010 |
| static std::uint32_t const | afOB_LAST = 0x040 |
| static std::uint32_t const | afAC_LAST = 0x080 |
Calculates payment paths.
The RippleCalc determines the quality of the found paths.
Definition at line 20 of file Pathfinder.h.
Definition at line 76 of file Pathfinder.h.
| Enumerator | |
|---|---|
| nt_SOURCE | |
| nt_ACCOUNTS | |
| nt_BOOKS | |
| nt_XRP_BOOK | |
| nt_DEST_BOOK | |
| nt_DESTINATION | |
Definition at line 66 of file Pathfinder.h.
| Enumerator | |
|---|---|
| pt_XRP_to_XRP | |
| pt_XRP_to_nonXRP | |
| pt_nonXRP_to_XRP | |
| pt_nonXRP_to_same | |
| pt_nonXRP_to_nonXRP | |
Definition at line 80 of file Pathfinder.h.
| ripple::Pathfinder::Pathfinder | ( | std::shared_ptr< RippleLineCache > const & | cache, |
| AccountID const & | srcAccount, | ||
| AccountID const & | dstAccount, | ||
| Currency const & | uSrcCurrency, | ||
| 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 142 of file Pathfinder.cpp.
|
delete |
|
default |
|
delete |
|
static |
Definition at line 1298 of file Pathfinder.cpp.
| bool ripple::Pathfinder::findPaths | ( | int | searchLevel, |
| std::function< bool(void)> const & | continueCallback = {} |
||
| ) |
Definition at line 181 of file Pathfinder.cpp.
| void ripple::Pathfinder::computePathRanks | ( | int | maxPaths, |
| std::function< bool(void)> const & | continueCallback = {} |
||
| ) |
Compute the rankings of the paths.
Definition at line 399 of file Pathfinder.cpp.
| STPathSet ripple::Pathfinder::getBestPaths | ( | int | maxPaths, |
| STPath & | fullLiquidityPath, | ||
| STPathSet const & | extraPaths, | ||
| AccountID const & | srcIssuer, | ||
| std::function< bool(void)> const & | continueCallback = {} |
||
| ) |
Definition at line 556 of file Pathfinder.cpp.
|
private |
Definition at line 790 of file Pathfinder.cpp.
|
private |
Definition at line 692 of file Pathfinder.cpp.
|
private |
Definition at line 703 of file Pathfinder.cpp.
|
private |
Definition at line 934 of file Pathfinder.cpp.
|
private |
Definition at line 773 of file Pathfinder.cpp.
|
private |
Definition at line 330 of file Pathfinder.cpp.
|
private |
Definition at line 899 of file Pathfinder.cpp.
|
private |
Definition at line 882 of file Pathfinder.cpp.
|
private |
Definition at line 478 of file Pathfinder.cpp.
|
staticprivatenoexceptinherited |
Definition at line 110 of file CountedObject.h.
|
private |
Definition at line 179 of file Pathfinder.h.
|
private |
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 183 of file Pathfinder.h.
|
private |
Definition at line 184 of file Pathfinder.h.
|
private |
Definition at line 185 of file Pathfinder.h.
|
private |
The amount remaining from mSrcAccount after the default liquidity has been removed.
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.
|
private |
Definition at line 192 of file Pathfinder.h.
|
private |
Definition at line 193 of file Pathfinder.h.
|
private |
Definition at line 194 of file Pathfinder.h.
|
private |
Definition at line 196 of file Pathfinder.h.
|
private |
Definition at line 197 of file Pathfinder.h.
|
private |
Definition at line 198 of file Pathfinder.h.
Definition at line 199 of file Pathfinder.h.
Definition at line 201 of file Pathfinder.h.
|
private |
Definition at line 203 of file Pathfinder.h.
|
private |
Definition at line 204 of file Pathfinder.h.
|
staticprivate |
Definition at line 207 of file Pathfinder.h.
|
staticprivate |
Definition at line 210 of file Pathfinder.h.
|
staticprivate |
Definition at line 213 of file Pathfinder.h.
|
staticprivate |
Definition at line 216 of file Pathfinder.h.
|
staticprivate |
Definition at line 219 of file Pathfinder.h.