Fetch pack scheme. Phase two.

This commit is contained in:
JoelKatz
2013-04-21 20:37:46 -07:00
parent 9c0a156c13
commit 0c7066944e
9 changed files with 70 additions and 83 deletions

View File

@@ -128,8 +128,7 @@ protected:
subMapType mSubTransactions; // all accepted transactions
subMapType mSubRTTransactions; // all proposed and accepted transactions
boost::recursive_mutex mWantedHashLock;
boost::unordered_set<uint256> mWantedHashes;
TaggedCache< uint256, std::vector<unsigned char> > mFetchPack;
uint32 mLastLoadBase;
uint32 mLastLoadFactor;
@@ -261,7 +260,10 @@ public:
void mapComplete(const uint256& hash, SHAMap::ref map);
bool stillNeedTXSet(const uint256& hash);
void makeFetchPack(Job&, boost::weak_ptr<Peer> peer, boost::shared_ptr<ripple::TMGetObjectByHash> request,
Ledger::pointer prevLedger, Ledger::pointer reqLedger);
Ledger::pointer wantLedger, Ledger::pointer haveLedger);
void addFetchPack(const uint256& hash, boost::shared_ptr< std::vector<unsigned char> >& data);
bool getFetchPack(const uint256& hash, std::vector<unsigned char>& data);
void sweepFetchPack();
// network state machine
void checkState(const boost::system::error_code& result);
@@ -294,9 +296,6 @@ public:
uint256 getConsensusLCL();
void reportFeeChange();
bool addWantedHash(const uint256& h);
bool isWantedHash(const uint256& h, bool remove);
//Helper function to generate SQL query to get transactions
std::string transactionsSQL(std::string selection, const RippleAddress& account,
int32 minLedger, int32 maxLedger, bool descending, uint32 offset, int limit,