mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
LevelDB is now mandatory
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
#include "HashedObject.h"
|
||||
|
||||
#ifdef USE_LEVELDB
|
||||
#include "leveldb/db.h"
|
||||
#include "leveldb/write_batch.h"
|
||||
#endif
|
||||
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
@@ -31,14 +29,6 @@ HashedObjectStore::HashedObjectStore(int cacheSize, int cacheAge) :
|
||||
WriteLog (lsFATAL, HashedObject) << "Incorrect database selection";
|
||||
assert(false);
|
||||
}
|
||||
#ifndef USE_LEVELDB
|
||||
if (mLevelDB)
|
||||
{
|
||||
WriteLog (lsFATAL) << "LevelDB has been selected but not compiled";
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void HashedObjectStore::tune(int size, int age)
|
||||
@@ -61,8 +51,6 @@ int HashedObjectStore::getWriteLoad()
|
||||
return std::max(mWriteLoad, static_cast<int>(mWriteSet.size()));
|
||||
}
|
||||
|
||||
#ifdef USE_LEVELDB
|
||||
|
||||
bool HashedObjectStore::storeLevelDB(HashedObjectType type, uint32 index,
|
||||
const std::vector<unsigned char>& data, const uint256& hash)
|
||||
{ // return: false = already in cache, true = added to cache
|
||||
@@ -177,8 +165,6 @@ HashedObject::pointer HashedObjectStore::retrieveLevelDB(const uint256& hash)
|
||||
return obj;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
bool HashedObjectStore::storeSQLite(HashedObjectType type, uint32 index,
|
||||
const std::vector<unsigned char>& data, const uint256& hash)
|
||||
{ // return: false = already in cache, true = added to cache
|
||||
@@ -405,8 +391,6 @@ HashedObject::pointer HashedObjectStore::retrieveSQLite(const uint256& hash)
|
||||
return obj;
|
||||
}
|
||||
|
||||
#ifdef USE_LEVELDB
|
||||
|
||||
int HashedObjectStore::import(const std::string& file)
|
||||
{
|
||||
WriteLog (lsWARNING, HashedObject) << "Hashed object import from \"" << file << "\".";
|
||||
@@ -476,6 +460,4 @@ int HashedObjectStore::import(const std::string& file)
|
||||
return count;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// vim:ts=4
|
||||
|
||||
Reference in New Issue
Block a user