mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-03 01:15:53 +00:00
LevelDB fixes.
This commit is contained in:
@@ -7,11 +7,12 @@ import platform
|
|||||||
import commands
|
import commands
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
LevelDB = bool(0)
|
||||||
|
|
||||||
OSX = bool(platform.mac_ver()[0])
|
OSX = bool(platform.mac_ver()[0])
|
||||||
FreeBSD = bool('FreeBSD' == platform.system())
|
FreeBSD = bool('FreeBSD' == platform.system())
|
||||||
Linux = bool('Linux' == platform.system())
|
Linux = bool('Linux' == platform.system())
|
||||||
Ubuntu = bool(Linux and 'Ubuntu' == platform.linux_distribution()[0])
|
Ubuntu = bool(Linux and 'Ubuntu' == platform.linux_distribution()[0])
|
||||||
LevelDB = bool(0)
|
|
||||||
|
|
||||||
if OSX or Ubuntu:
|
if OSX or Ubuntu:
|
||||||
CTAGS = '/usr/bin/ctags'
|
CTAGS = '/usr/bin/ctags'
|
||||||
@@ -116,7 +117,7 @@ if OSX:
|
|||||||
|
|
||||||
if LevelDB:
|
if LevelDB:
|
||||||
env.Append(CXXFLAGS = [ '-Isrc/cpp/leveldb/include', '-DUSE_LEVELDB'])
|
env.Append(CXXFLAGS = [ '-Isrc/cpp/leveldb/include', '-DUSE_LEVELDB'])
|
||||||
env.Append(LINKFLAGS = [ '-Lsrc/cpp/leveldb/lib' ])
|
env.Append(LINKFLAGS = [ '-Lsrc/cpp/leveldb' ])
|
||||||
env.Append(LIBS = [ '-lleveldb'])
|
env.Append(LIBS = [ '-lleveldb'])
|
||||||
|
|
||||||
DB_SRCS = glob.glob('src/cpp/database/*.c') + glob.glob('src/cpp/database/*.cpp')
|
DB_SRCS = glob.glob('src/cpp/database/*.c') + glob.glob('src/cpp/database/*.cpp')
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
|
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
|
|
||||||
|
#ifdef USE_LEVELDB
|
||||||
|
#include "leveldb/cache.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "AcceptedLedger.h"
|
#include "AcceptedLedger.h"
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
#include "PeerDoor.h"
|
#include "PeerDoor.h"
|
||||||
@@ -162,6 +167,7 @@ void Application::setup()
|
|||||||
#ifdef USE_LEVELDB
|
#ifdef USE_LEVELDB
|
||||||
leveldb::Options options;
|
leveldb::Options options;
|
||||||
options.create_if_missing = true;
|
options.create_if_missing = true;
|
||||||
|
options.block_cache = leveldb::NewLRUCache(theConfig.getSize(siHashNodeDBCache) * 1024 * 1024);
|
||||||
leveldb::Status status = leveldb::DB::Open(options, (theConfig.DATA_DIR / "hashnode").string(), &mHashNodeDB);
|
leveldb::Status status = leveldb::DB::Open(options, (theConfig.DATA_DIR / "hashnode").string(), &mHashNodeDB);
|
||||||
if (!status.ok() || !mHashNodeDB)
|
if (!status.ok() || !mHashNodeDB)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user