Second check if fetch pack should be skipped.

This commit is contained in:
JoelKatz
2013-05-17 01:02:01 -07:00
parent 4d0f02a46a
commit 5e1dddd1c7
3 changed files with 15 additions and 2 deletions

View File

@@ -285,6 +285,12 @@ bool LoadFeeTrack::raiseLocalFee()
return true;
}
bool LoadFeeTrack::isLoaded()
{
boost::mutex::scoped_lock sl(mLock);
return (raiseCount != 0) || (mLocalTxnLoadFee != lftNormalFee);
}
bool LoadFeeTrack::lowerLocalFee()
{
boost::mutex::scoped_lock sl(mLock);

View File

@@ -185,7 +185,7 @@ public:
void setRemoteFee(uint32);
bool raiseLocalFee();
bool lowerLocalFee();
bool isLoaded() { return (raiseCount != 0) || (mLocalTxnLoadFee != lftNormalFee); }
bool isLoaded();
};

View File

@@ -2004,9 +2004,16 @@ void NetworkOPs::getBookPage(Ledger::pointer lpLedger, const uint160& uTakerPays
// jvResult["nodes"] = Json::Value(Json::arrayValue);
}
void NetworkOPs::makeFetchPack(Job&, boost::weak_ptr<Peer> wPeer, boost::shared_ptr<ripple::TMGetObjectByHash> request,
void NetworkOPs::makeFetchPack(Job&, boost::weak_ptr<Peer> wPeer,
boost::shared_ptr<ripple::TMGetObjectByHash> request,
Ledger::pointer wantLedger, Ledger::pointer haveLedger)
{
if (theApp->getFeeTrack().isLoaded())
{
cLog(lsINFO) << "Too busy to make fetch pack";
return;
}
try
{
Peer::pointer peer = wPeer.lock();