diff --git a/src/cpp/ripple/LoadManager.cpp b/src/cpp/ripple/LoadManager.cpp index 46965ff2b2..3f5fb662c2 100644 --- a/src/cpp/ripple/LoadManager.cpp +++ b/src/cpp/ripple/LoadManager.cpp @@ -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); diff --git a/src/cpp/ripple/LoadManager.h b/src/cpp/ripple/LoadManager.h index 07722b9e62..4257b21afa 100644 --- a/src/cpp/ripple/LoadManager.h +++ b/src/cpp/ripple/LoadManager.h @@ -185,7 +185,7 @@ public: void setRemoteFee(uint32); bool raiseLocalFee(); bool lowerLocalFee(); - bool isLoaded() { return (raiseCount != 0) || (mLocalTxnLoadFee != lftNormalFee); } + bool isLoaded(); }; diff --git a/src/cpp/ripple/NetworkOPs.cpp b/src/cpp/ripple/NetworkOPs.cpp index 4b09dde554..f7734311e4 100644 --- a/src/cpp/ripple/NetworkOPs.cpp +++ b/src/cpp/ripple/NetworkOPs.cpp @@ -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 wPeer, boost::shared_ptr request, +void NetworkOPs::makeFetchPack(Job&, boost::weak_ptr wPeer, + boost::shared_ptr 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();