| 
    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 39 of file Pathfinder.h.
Definition at line 95 of file Pathfinder.h.
| Enumerator | |
|---|---|
| nt_SOURCE | |
| nt_ACCOUNTS | |
| nt_BOOKS | |
| nt_XRP_BOOK | |
| nt_DEST_BOOK | |
| nt_DESTINATION | |
Definition at line 85 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 99 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 161 of file Pathfinder.cpp.
      
  | 
  delete | 
      
  | 
  default | 
      
  | 
  delete | 
      
  | 
  static | 
Definition at line 1317 of file Pathfinder.cpp.
| bool ripple::Pathfinder::findPaths | ( | int | searchLevel, | 
| std::function< bool(void)> const & | continueCallback = {}  | 
        ||
| ) | 
Definition at line 200 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 418 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 575 of file Pathfinder.cpp.
      
  | 
  private | 
Definition at line 809 of file Pathfinder.cpp.
      
  | 
  private | 
Definition at line 711 of file Pathfinder.cpp.
      
  | 
  private | 
Definition at line 722 of file Pathfinder.cpp.
      
  | 
  private | 
Definition at line 953 of file Pathfinder.cpp.
      
  | 
  private | 
Definition at line 792 of file Pathfinder.cpp.
      
  | 
  private | 
Definition at line 349 of file Pathfinder.cpp.
      
  | 
  private | 
Definition at line 918 of file Pathfinder.cpp.
      
  | 
  private | 
Definition at line 901 of file Pathfinder.cpp.
      
  | 
  private | 
Definition at line 497 of file Pathfinder.cpp.
      
  | 
  staticprivatenoexceptinherited | 
Definition at line 129 of file CountedObject.h.
      
  | 
  private | 
Definition at line 198 of file Pathfinder.h.
      
  | 
  private | 
Definition at line 199 of file Pathfinder.h.
      
  | 
  private | 
Definition at line 200 of file Pathfinder.h.
      
  | 
  private | 
Definition at line 201 of file Pathfinder.h.
      
  | 
  private | 
Definition at line 202 of file Pathfinder.h.
      
  | 
  private | 
Definition at line 203 of file Pathfinder.h.
      
  | 
  private | 
Definition at line 204 of file Pathfinder.h.
      
  | 
  private | 
The amount remaining from mSrcAccount after the default liquidity has been removed.
Definition at line 207 of file Pathfinder.h.
      
  | 
  private | 
Definition at line 208 of file Pathfinder.h.
      
  | 
  private | 
Definition at line 209 of file Pathfinder.h.
      
  | 
  private | 
Definition at line 211 of file Pathfinder.h.
      
  | 
  private | 
Definition at line 212 of file Pathfinder.h.
      
  | 
  private | 
Definition at line 213 of file Pathfinder.h.
      
  | 
  private | 
Definition at line 215 of file Pathfinder.h.
      
  | 
  private | 
Definition at line 216 of file Pathfinder.h.
      
  | 
  private | 
Definition at line 217 of file Pathfinder.h.
Definition at line 218 of file Pathfinder.h.
Definition at line 220 of file Pathfinder.h.
      
  | 
  private | 
Definition at line 222 of file Pathfinder.h.
      
  | 
  private | 
Definition at line 223 of file Pathfinder.h.
      
  | 
  staticprivate | 
Definition at line 226 of file Pathfinder.h.
      
  | 
  staticprivate | 
Definition at line 229 of file Pathfinder.h.
      
  | 
  staticprivate | 
Definition at line 232 of file Pathfinder.h.
      
  | 
  staticprivate | 
Definition at line 235 of file Pathfinder.h.
      
  | 
  staticprivate | 
Definition at line 238 of file Pathfinder.h.