aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_db/lmdb
diff options
context:
space:
mode:
authorThomas Winget <tewinget@gmail.com>2015-03-25 11:41:30 -0400
committerThomas Winget <tewinget@gmail.com>2015-03-25 12:09:44 -0400
commit7b14d4a17f739c383322312f1a597f264c074c6e (patch)
tree3934f69a876d5f10637c93fc868d5a8f139aa164 /src/blockchain_db/lmdb
parentupdate berkeleydb branch to blockchain branch (diff)
downloadmonero-7b14d4a17f739c383322312f1a597f264c074c6e.tar.xz
Steps toward multiple dbs available -- working
There will need to be some more refactoring for these changes to be considered complete/correct, but for now it's working. new daemon cli argument "--db-type", works for LMDB and BerkeleyDB. A good deal of refactoring is also present in this commit, namely Blockchain no longer instantiates BlockchainDB, but rather is passed a pointer to an already-instantiated BlockchainDB on init().
Diffstat (limited to 'src/blockchain_db/lmdb')
-rw-r--r--src/blockchain_db/lmdb/db_lmdb.cpp7
-rw-r--r--src/blockchain_db/lmdb/db_lmdb.h4
2 files changed, 1 insertions, 10 deletions
diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp
index 524a1c269..8e09dfab2 100644
--- a/src/blockchain_db/lmdb/db_lmdb.cpp
+++ b/src/blockchain_db/lmdb/db_lmdb.cpp
@@ -733,13 +733,6 @@ void BlockchainLMDB::open(const std::string& filename, const int mdb_flags)
// from here, init should be finished
}
-// unused for now, create will happen on open if doesn't exist
-void BlockchainLMDB::create(const std::string& filename)
-{
- LOG_PRINT_L3("BlockchainLMDB::" << __func__);
- throw DB_CREATE_FAILURE("create() is not implemented for this BlockchainDB, open() will create files if needed.");
-}
-
void BlockchainLMDB::close()
{
LOG_PRINT_L3("BlockchainLMDB::" << __func__);
diff --git a/src/blockchain_db/lmdb/db_lmdb.h b/src/blockchain_db/lmdb/db_lmdb.h
index c3c7ce439..8f1e07e0d 100644
--- a/src/blockchain_db/lmdb/db_lmdb.h
+++ b/src/blockchain_db/lmdb/db_lmdb.h
@@ -24,6 +24,7 @@
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#pragma once
#include "blockchain_db/blockchain_db.h"
#include "cryptonote_protocol/blobdatatype.h" // for type blobdata
@@ -116,8 +117,6 @@ public:
virtual void open(const std::string& filename, const int mdb_flags=0);
- virtual void create(const std::string& filename);
-
virtual void close();
virtual void sync();
@@ -302,7 +301,6 @@ private:
MDB_dbi m_spent_keys;
- bool m_open;
uint64_t m_height;
uint64_t m_num_outputs;
std::string m_folder;