Split up InfoSub and tidy up various files

This commit is contained in:
Vinnie Falco
2013-06-07 20:59:53 -07:00
parent 5e685aa55b
commit 3273625f61
138 changed files with 3155 additions and 2678 deletions

View File

@@ -1,12 +1,4 @@
/*
#include "HashedObject.h"
#include "leveldb/db.h"
#include "leveldb/write_batch.h"
#include "../database/SqliteDatabase.h"
#include "Application.h"
*/
HashedObjectStore::HashedObjectStore(int cacheSize, int cacheAge) :
mCache("HashedObjectStore", cacheSize, cacheAge), mNegativeCache("HashedObjectNegativeCache", 0, 120),
mWriteGeneration(0), mWriteLoad(0), mWritePending(false), mLevelDB(false), mEphemeralDB(false)
@@ -47,7 +39,7 @@ int HashedObjectStore::getWriteLoad()
}
// low-level retrieve
HashedObject::pointer HashedObjectStore::LLRetrieve(const uint256& hash, leveldb::DB* db)
HashedObject::pointer HashedObjectStore::LLRetrieve(uint256 const& hash, leveldb::DB* db)
{
std::string sData;
@@ -118,7 +110,7 @@ void HashedObjectStore::LLWrite(const std::vector< boost::shared_ptr<HashedObjec
}
bool HashedObjectStore::storeLevelDB(HashedObjectType type, uint32 index,
Blob const& data, const uint256& hash)
Blob const& data, uint256 const& hash)
{ // return: false = already in cache, true = added to cache
if (!theApp->getHashNodeLDB())
return true;
@@ -178,7 +170,7 @@ void HashedObjectStore::bulkWriteLevelDB(Job &)
}
}
HashedObject::pointer HashedObjectStore::retrieveLevelDB(const uint256& hash)
HashedObject::pointer HashedObjectStore::retrieveLevelDB(uint256 const& hash)
{
HashedObject::pointer obj = mCache.fetch(hash);
if (obj || mNegativeCache.isPresent(hash) || !theApp || !theApp->getHashNodeLDB())
@@ -214,7 +206,7 @@ HashedObject::pointer HashedObjectStore::retrieveLevelDB(const uint256& hash)
}
bool HashedObjectStore::storeSQLite(HashedObjectType type, uint32 index,
Blob const& data, const uint256& hash)
Blob const& data, uint256 const& hash)
{ // return: false = already in cache, true = added to cache
if (!theApp->getHashNodeDB())
{
@@ -351,7 +343,7 @@ void HashedObjectStore::bulkWriteSQLite(Job&)
}
}
HashedObject::pointer HashedObjectStore::retrieveSQLite(const uint256& hash)
HashedObject::pointer HashedObjectStore::retrieveSQLite(uint256 const& hash)
{
HashedObject::pointer obj = mCache.fetch(hash);
if (obj)