mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-19 18:45:52 +00:00
Permit pathfinding to be disabled. (RIPD-271)
If you do not need pathfinding, you can disable it and save some resources by setting path_search_max to zero in your config file.
This commit is contained in:
@@ -527,6 +527,9 @@
|
||||
# [path_search_max]
|
||||
# When searching for paths, the minimum and maximum search aggressiveness.
|
||||
#
|
||||
# If you do not need pathfinding, you can set path_search_max to zero to
|
||||
# disable it and avoid some expensive bookkeeping.
|
||||
#
|
||||
# The default for 'path_search_fast' is 2. The default for 'path_search_max' is 10.
|
||||
#
|
||||
# [path_search_old]
|
||||
|
||||
@@ -66,7 +66,11 @@ void OrderBookDB::setup(
|
||||
mSeq = seq;
|
||||
}
|
||||
|
||||
if (app_.config().RUN_STANDALONE)
|
||||
if (app_.config().PATH_SEARCH_MAX == 0)
|
||||
{
|
||||
// nothing to do
|
||||
}
|
||||
else if (app_.config().RUN_STANDALONE)
|
||||
update(ledger);
|
||||
else
|
||||
app_.getJobQueue().addJob(
|
||||
@@ -84,6 +88,12 @@ void OrderBookDB::update(
|
||||
|
||||
JLOG (j_.debug) << "OrderBookDB::update>";
|
||||
|
||||
if (app_.config().PATH_SEARCH_MAX == 0)
|
||||
{
|
||||
// pathfinding has been disabled
|
||||
return;
|
||||
}
|
||||
|
||||
// walk through the entire ledger looking for orderbook entries
|
||||
int books = 0;
|
||||
|
||||
|
||||
@@ -32,6 +32,9 @@ namespace ripple {
|
||||
|
||||
Json::Value doPathFind (RPC::Context& context)
|
||||
{
|
||||
if (context.app.config().PATH_SEARCH_MAX == 0)
|
||||
return rpcError (rpcNOT_SUPPORTED);
|
||||
|
||||
auto lpLedger = context.ledgerMaster.getClosedLedger();
|
||||
|
||||
if (!context.params.isMember (jss::subcommand) ||
|
||||
|
||||
@@ -70,6 +70,9 @@ buildSrcCurrencies(AccountID const& account,
|
||||
// This interface is deprecated.
|
||||
Json::Value doRipplePathFind (RPC::Context& context)
|
||||
{
|
||||
if (context.app.config().PATH_SEARCH_MAX == 0)
|
||||
return rpcError (rpcNOT_SUPPORTED);
|
||||
|
||||
RPC::LegacyPathFind lpf (context.role == Role::ADMIN, context.app);
|
||||
if (!lpf.isOk ())
|
||||
return rpcError (rpcTOO_BUSY);
|
||||
|
||||
Reference in New Issue
Block a user