JSON cache for account offers and account lines.

This commit is contained in:
JoelKatz
2013-06-12 15:25:51 -07:00
parent 4de1dcae5e
commit 987dc25a48
5 changed files with 75 additions and 24 deletions

View File

@@ -176,6 +176,16 @@ public:
int getFetchSize();
void sweepFetchPack();
float getJSONHitRate() { return mJSONCache.getHitRate(); }
int getJSONEntries() { return mJSONCache.getCount(); }
void storeJSONCache(int operation, const uint256& ledger, const uint160& object,
const boost::shared_ptr<Json::Value>& data)
{ mJSONCache.storeEntry(operation, ledger, object, data); }
boost::shared_ptr<Json::Value> getJSONCache(int operation, const uint256& ledger, const uint160& object)
{ return mJSONCache.getEntry(operation, ledger, object); }
// network state machine
void checkState(const boost::system::error_code& result);
void switchLastClosedLedger(Ledger::pointer newLedger, bool duringConsensus); // Used for the "jump" case
@@ -303,6 +313,8 @@ private:
subMapType mSubTransactions; // all accepted transactions
subMapType mSubRTTransactions; // all proposed and accepted transactions
JSONCache<UptimeTimerAdapter> mJSONCache;
TaggedCache< uint256, Blob , UptimeTimerAdapter > mFetchPack;
uint32 mLastFetchPack;
uint32 mFetchSeq;