Don't make a fetch pack if load is too high.

This commit is contained in:
JoelKatz
2013-04-23 06:59:47 -07:00
parent 0cc465a812
commit 0643f8635b
2 changed files with 6 additions and 0 deletions

View File

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

View File

@@ -1858,6 +1858,11 @@ void Peer::doProofOfWork(Job&, boost::weak_ptr<Peer> peer, ProofOfWork::pointer
void Peer::doFetchPack(const boost::shared_ptr<ripple::TMGetObjectByHash>& packet)
{
if (theApp->getFeeTrack().isLoaded())
{
cLog(lsINFO) << "Too busy to make fetch pack";
return;
}
if (packet->ledgerhash().size() != 32)
{
cLog(lsWARNING) << "FetchPack hash size malformed";