mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Pathfinding improvements.
This commit is contained in:
@@ -256,6 +256,12 @@ Json::Value PathRequest::doStatus (const Json::Value&)
|
||||
return jvStatus;
|
||||
}
|
||||
|
||||
void PathRequest::resetLevel (int l)
|
||||
{
|
||||
if (iLastLevel > l)
|
||||
iLastLevel = l;
|
||||
}
|
||||
|
||||
bool PathRequest::doUpdate (RippleLineCache::ref cache, bool fast)
|
||||
{
|
||||
WriteLog (lsDEBUG, PathRequest) << iIdentifier << " update " << (fast ? "fast" : "normal");
|
||||
@@ -403,7 +409,7 @@ bool PathRequest::doUpdate (RippleLineCache::ref cache, bool fast)
|
||||
return true;
|
||||
}
|
||||
|
||||
void PathRequest::updateAll (Ledger::ref ledger, bool newOnly, CancelCallback shouldCancel)
|
||||
void PathRequest::updateAll (Ledger::ref ledger, bool newOnly, bool hasNew, CancelCallback shouldCancel)
|
||||
{
|
||||
std::set<wptr> requests;
|
||||
|
||||
@@ -433,6 +439,10 @@ void PathRequest::updateAll (Ledger::ref ledger, bool newOnly, CancelCallback sh
|
||||
|
||||
if (pRequest)
|
||||
{
|
||||
// Drop old requests level to get new ones done faster
|
||||
if (hasNew)
|
||||
pRequest->resetLevel(getConfig().PATH_SEARCH);
|
||||
|
||||
if (newOnly && !pRequest->isNew ())
|
||||
remove = false;
|
||||
else
|
||||
|
||||
@@ -58,10 +58,11 @@ public:
|
||||
|
||||
bool doUpdate (const boost::shared_ptr<RippleLineCache>&, bool fast); // update jvStatus
|
||||
|
||||
static void updateAll (const boost::shared_ptr<Ledger>& ledger, bool newOnly, CancelCallback shouldCancel);
|
||||
static void updateAll (const boost::shared_ptr<Ledger>& ledger, bool newOnly, bool hasNew, CancelCallback shouldCancel);
|
||||
|
||||
private:
|
||||
void setValid ();
|
||||
void resetLevel (int level);
|
||||
int parseJson (const Json::Value&, bool complete);
|
||||
|
||||
typedef RippleRecursiveMutex LockType;
|
||||
|
||||
Reference in New Issue
Block a user