mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Clean up Pathfinder.
* Restrict to 80-columns and other style cleanups. * Make pathfinding a free function and hide the class Pathfinder. * Split off unrelated utility functions into separate files. Conflicts: src/ripple/rpc/handlers/RipplePathFind.cpp
This commit is contained in:
committed by
Vinnie Falco
parent
b30b2a523f
commit
c2f2f83b7c
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include <ripple/app/paths/FindPaths.h>
|
||||
#include <ripple/basics/StringUtilities.h>
|
||||
#include <ripple/rpc/impl/TransactionSign.h>
|
||||
#include <beast/unit_test.h>
|
||||
@@ -151,22 +152,20 @@ static Json::Value signPayment(
|
||||
if (!lpf.isOk ())
|
||||
return rpcError (rpcTOO_BUSY);
|
||||
|
||||
bool bValid;
|
||||
auto cache = std::make_shared<RippleLineCache> (lSnapshot);
|
||||
Pathfinder pf (
|
||||
STPath fullLiquidityPath;
|
||||
auto valid = findPathsForOneIssuer (
|
||||
cache,
|
||||
raSrcAddressID,
|
||||
dstAccountID,
|
||||
saSendMax.getCurrency (),
|
||||
saSendMax.getIssuer (),
|
||||
amount, bValid);
|
||||
raSrcAddressID.getAccountID(),
|
||||
dstAccountID.getAccountID(),
|
||||
saSendMax.issue (),
|
||||
amount,
|
||||
getConfig ().PATH_SEARCH_OLD,
|
||||
4, // iMaxPaths
|
||||
spsPaths,
|
||||
fullLiquidityPath);
|
||||
|
||||
STPath extraPath;
|
||||
if (!bValid ||
|
||||
!pf.findPaths (getConfig ().PATH_SEARCH_OLD,
|
||||
4,
|
||||
spsPaths,
|
||||
extraPath))
|
||||
if (!valid)
|
||||
{
|
||||
WriteLog (lsDEBUG, RPCHandler)
|
||||
<< "transactionSign: build_path: No paths found.";
|
||||
|
||||
Reference in New Issue
Block a user