diff --git a/modules/ripple_app/misc/NetworkOPs.cpp b/modules/ripple_app/misc/NetworkOPs.cpp index 8fc1e8799d..719033b7fc 100644 --- a/modules/ripple_app/misc/NetworkOPs.cpp +++ b/modules/ripple_app/misc/NetworkOPs.cpp @@ -32,9 +32,7 @@ NetworkOPs::NetworkOPs (LedgerMaster* pLedgerMaster) , mLastCloseTime (0) , mLastValidationTime (0) , mFetchPack ("FetchPack", 2048, 20) - , mLastFetchPack (0) - // VFALCO TODO Give this magic number a name - , mFetchSeq (static_cast (-1)) + , mFetchSeq (0) , mLastLoadBase (256) , mLastLoadFactor (256) { @@ -2351,28 +2349,9 @@ bool NetworkOPs::getFetchPack (uint256 const& hash, Blob& data) bool NetworkOPs::shouldFetchPack (uint32 seq) { - uint32 now = getNetworkTimeNC (); - - if (mLastFetchPack == now) + if (mFetchSeq == seq); return false; - - if (seq < mFetchSeq) // fetch pack has only data for ledgers ahead of where we are - mFetchPack.clear (); - else - mFetchPack.sweep (); - - int size = mFetchPack.getCacheSize (); - if (size == 0) - { - mFetchSeq = 0; - } - else if (size > 128) - { - return false; - } - - mLastFetchPack = now; - + mFetchSeq = seq; return true; } @@ -2383,8 +2362,6 @@ int NetworkOPs::getFetchSize () void NetworkOPs::gotFetchPack (bool progress, uint32 seq) { - mLastFetchPack = 0; - mFetchSeq = seq; // earliest pack we have data on getApp().getJobQueue ().addJob (jtLEDGER_DATA, "gotFetchPack", BIND_TYPE (&InboundLedgers::gotFetchPack, &getApp().getInboundLedgers (), P_1)); } diff --git a/modules/ripple_app/misc/NetworkOPs.h b/modules/ripple_app/misc/NetworkOPs.h index e47ad502ef..52e88404fd 100644 --- a/modules/ripple_app/misc/NetworkOPs.h +++ b/modules/ripple_app/misc/NetworkOPs.h @@ -433,12 +433,6 @@ private: SubMapType mSubRTTransactions; // all proposed and accepted transactions TaggedCache< uint256, Blob , UptimeTimerAdapter > mFetchPack; - uint32 mLastFetchPack; - - // VFALCO TODO Document the special value uint32(-1) for this member - // and replace uint32(-1) with a constant. It is initialized - // in the ctor-initializer list to this constant. - // uint32 mFetchSeq; uint32 mLastLoadBase;