Skip to content

Commit

Permalink
Add Google's LevelDB support
Browse files Browse the repository at this point in the history
This commit imports LevelDB database sources tree and implements alternative CTxDB storage methods implementation (backported from bitcoin 0.8).
  • Loading branch information
alex authored and alex committed Aug 25, 2013
1 parent 5d0ece5 commit adb8391
Show file tree
Hide file tree
Showing 161 changed files with 29,319 additions and 453 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ qrc_*.cpp
#mac specific
.DS_Store
build

!src/leveldb/Makefile
26 changes: 26 additions & 0 deletions novacoin-qt.pro
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,31 @@ contains(BITCOIN_NEED_QT_PLUGINS, 1) {
QTPLUGIN += qcncodecs qjpcodecs qtwcodecs qkrcodecs qtaccessiblewidgets
}

contains(USE_LEVELDB, -) {
message(Building without LevelDB)
SOURCES += src/txdb-bdb.cpp
} else {
message(Building with LevelDB)
DEFINES += USE_LEVELDB
INCLUDEPATH += src/leveldb/include src/leveldb/helpers
LIBS += $$PWD/src/leveldb/libleveldb.a $$PWD/src/leveldb/libmemenv.a
SOURCES += src/txdb-leveldb.cpp
!windows {
genleveldb.commands = cd $$PWD/src/leveldb ; make libleveldb.a libmemenv.a
} else {
# make an educated guess about what the ranlib command is called
isEmpty(QMAKE_RANLIB) {
QMAKE_RANLIB = $$replace(QMAKE_STRIP, strip, ranlib)
}
genleveldb.commands = cd $$PWD/src/leveldb ; CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE CXXFLAGS="-I$$BOOST_INCLUDE_PATH" LDFLAGS="-L$$BOOST_LIB_PATH" make libleveldb.a libmemenv.a ; $$QMAKE_RANLIB $$PWD/src/leveldb/libleveldb.a
}
genleveldb.target = $$PWD/src/leveldb/libleveldb.a
genleveldb.depends = FORCE
PRE_TARGETDEPS += $$PWD/src/leveldb/libleveldb.a
QMAKE_EXTRA_TARGETS += genleveldb
# Gross ugly hack that depends on qmake internals, unfortunately there's no other way to do it.
QMAKE_CLEAN += $$PWD/src/leveldb/libleveldb.a; cd $$PWD/src/leveldb ; make clean
}

# regenerate src/build.h
!windows|contains(USE_BUILD_INFO, 1) {
Expand Down Expand Up @@ -136,6 +161,7 @@ HEADERS += src/qt/bitcoingui.h \
src/net.h \
src/key.h \
src/db.h \
src/txdb.h \
src/walletdb.h \
src/script.h \
src/init.h \
Expand Down
2 changes: 1 addition & 1 deletion src/checkpoints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "checkpoints.h"

#include "db.h"
#include "txdb.h"
#include "main.h"
#include "uint256.h"

Expand Down
Loading

0 comments on commit adb8391

Please sign in to comment.