Fix pathfinding aggressiveness logic.

This commit is contained in:
David Schwartz
2013-08-20 10:51:38 -07:00
parent beb50496a4
commit a2f90da10c
2 changed files with 11 additions and 10 deletions

View File

@@ -680,7 +680,6 @@ void LedgerMaster::advanceThread()
getApp().getOPs().clearNeedNetworkLedger();
mPathFindNewLedger = true;
if (!mPathFindThread)
{
mPathFindThread = true;
@@ -832,26 +831,28 @@ void LedgerMaster::updatePaths ()
do
{
bool newOnly = false;
bool newOnly = true;
{
boost::recursive_mutex::scoped_lock ml (mLock);
if (mPathFindNewLedger || (lastLedger && (lastLedger.get () != mPubLedger.get ())))
lastLedger = mPubLedger;
if (!mPathLedger || (mPathLedger->getLedgerSeq() < mValidLedger->getLedgerSeq()))
{ // We have a new valid ledger since the last full pathfinding
newOnly = false;
mPathLedger = mValidLedger;
lastLedger = mPathLedger;
}
else if (mPathFindNewRequest)
{
{ // We have a new request but no new ledger
newOnly = true;
lastLedger = boost::make_shared<Ledger> (boost::ref (*mCurrentLedger), false);
}
else
{
{ // Nothing to do
mPathFindThread = false;
return;
}
lastLedger = mPubLedger;
mPathFindNewLedger = false;
mPathFindNewRequest = false;
}

View File

@@ -27,7 +27,6 @@ public:
, mAdvanceThread (false)
, mFillInProgress (false)
, mPathFindThread (false)
, mPathFindNewLedger (false)
, mPathFindNewRequest (false)
{
}
@@ -203,9 +202,10 @@ private:
Ledger::pointer mCurrentLedger; // The ledger we are currently processiong
Ledger::pointer mCurrentSnapshot; // Snapshot of the current ledger
Ledger::pointer mClosedLedger; // The ledger that most recently closed
Ledger::pointer mClosedLedger; // The ledger that most recently closed
Ledger::pointer mValidLedger; // The highest-sequence ledger we have fully accepted
Ledger::pointer mPubLedger; // The last ledger we have published
Ledger::pointer mPathLedger; // The last ledger we did pathfinding against
LedgerHistory mLedgerHistory;