mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-03 01:15:53 +00:00
Make pathfinder search size configurable, reduce to 5.
This commit is contained in:
@@ -28,6 +28,7 @@
|
|||||||
#define SECTION_NETWORK_QUORUM "network_quorum"
|
#define SECTION_NETWORK_QUORUM "network_quorum"
|
||||||
#define SECTION_NODE_SEED "node_seed"
|
#define SECTION_NODE_SEED "node_seed"
|
||||||
#define SECTION_NODE_SIZE "node_size"
|
#define SECTION_NODE_SIZE "node_size"
|
||||||
|
#define SECTION_PATH_SEARCH_SIZE "path_search_size"
|
||||||
#define SECTION_PEER_CONNECT_LOW_WATER "peer_connect_low_water"
|
#define SECTION_PEER_CONNECT_LOW_WATER "peer_connect_low_water"
|
||||||
#define SECTION_PEER_IP "peer_ip"
|
#define SECTION_PEER_IP "peer_ip"
|
||||||
#define SECTION_PEER_PORT "peer_port"
|
#define SECTION_PEER_PORT "peer_port"
|
||||||
@@ -219,6 +220,7 @@ Config::Config()
|
|||||||
|
|
||||||
LEDGER_HISTORY = 256;
|
LEDGER_HISTORY = 256;
|
||||||
|
|
||||||
|
PATH_SEARCH_SIZE = DEFAULT_PATH_SEARCH_SIZE;
|
||||||
ACCOUNT_PROBE_MAX = 10;
|
ACCOUNT_PROBE_MAX = 10;
|
||||||
|
|
||||||
VALIDATORS_SITE = DEFAULT_VALIDATORS_SITE;
|
VALIDATORS_SITE = DEFAULT_VALIDATORS_SITE;
|
||||||
@@ -445,6 +447,9 @@ void Config::load()
|
|||||||
LEDGER_HISTORY = boost::lexical_cast<uint32>(strTemp);
|
LEDGER_HISTORY = boost::lexical_cast<uint32>(strTemp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sectionSingleB(secConfig, SECTION_PATH_SEARCH_SIZE, strTemp))
|
||||||
|
PATH_SEARCH_SIZE = boost::lexical_cast<int>(strTemp);
|
||||||
|
|
||||||
if (sectionSingleB(secConfig, SECTION_ACCOUNT_PROBE_MAX, strTemp))
|
if (sectionSingleB(secConfig, SECTION_ACCOUNT_PROBE_MAX, strTemp))
|
||||||
ACCOUNT_PROBE_MAX = boost::lexical_cast<int>(strTemp);
|
ACCOUNT_PROBE_MAX = boost::lexical_cast<int>(strTemp);
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,9 @@ const int SYSTEM_WEBSOCKET_PUBLIC_PORT = 6563; // XXX Going away.
|
|||||||
// Might connect with fewer for testing.
|
// Might connect with fewer for testing.
|
||||||
#define DEFAULT_PEER_CONNECT_LOW_WATER 4
|
#define DEFAULT_PEER_CONNECT_LOW_WATER 4
|
||||||
|
|
||||||
|
// Grows exponentially worse.
|
||||||
|
#define DEFAULT_PATH_SEARCH_SIZE 5
|
||||||
|
|
||||||
enum SizedItemName
|
enum SizedItemName
|
||||||
{
|
{
|
||||||
siSweepInterval,
|
siSweepInterval,
|
||||||
@@ -142,6 +145,9 @@ public:
|
|||||||
bool RPC_ALLOW_REMOTE;
|
bool RPC_ALLOW_REMOTE;
|
||||||
Json::Value RPC_STARTUP;
|
Json::Value RPC_STARTUP;
|
||||||
|
|
||||||
|
// Path searching
|
||||||
|
int PATH_SEARCH_SIZE;
|
||||||
|
|
||||||
// Validation
|
// Validation
|
||||||
RippleAddress VALIDATION_SEED, VALIDATION_PUB, VALIDATION_PRIV;
|
RippleAddress VALIDATION_SEED, VALIDATION_PUB, VALIDATION_PRIV;
|
||||||
|
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ Json::Value RPCHandler::transactionSign(Json::Value jvRequest, bool bSubmit)
|
|||||||
|
|
||||||
Pathfinder pf(raSrcAddressID, dstAccountID, saSendMax.getCurrency(), saSendMax.getIssuer(), saSend);
|
Pathfinder pf(raSrcAddressID, dstAccountID, saSendMax.getCurrency(), saSendMax.getIssuer(), saSend);
|
||||||
|
|
||||||
if (!pf.findPaths(7, 3, spsPaths))
|
if (!pf.findPaths(theConfig.PATH_SEARCH_SIZE, 3, spsPaths))
|
||||||
{
|
{
|
||||||
cLog(lsDEBUG) << "transactionSign: build_path: No paths found.";
|
cLog(lsDEBUG) << "transactionSign: build_path: No paths found.";
|
||||||
|
|
||||||
@@ -1150,7 +1150,7 @@ Json::Value RPCHandler::doRipplePathFind(Json::Value jvRequest)
|
|||||||
STPathSet spsComputed;
|
STPathSet spsComputed;
|
||||||
Pathfinder pf(raSrc, raDst, uSrcCurrencyID, uSrcIssuerID, saDstAmount);
|
Pathfinder pf(raSrc, raDst, uSrcCurrencyID, uSrcIssuerID, saDstAmount);
|
||||||
|
|
||||||
if (!pf.findPaths(7, 3, spsComputed))
|
if (!pf.findPaths(theConfig.PATH_SEARCH_SIZE, 3, spsComputed))
|
||||||
{
|
{
|
||||||
cLog(lsDEBUG) << "ripple_path_find: No paths found.";
|
cLog(lsDEBUG) << "ripple_path_find: No paths found.";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user