BlockchainDB implementations have names now
In order to make things more general, BlockchainDB now has get_db_name() which should return a string with the "name" of that type of db. This "name" will be the subfolder name that holds that db type's files within the monero folder. Small bugfix: blockchain_converter was not correctly appending this in the prior hard-coded-string implementation of the subfolder data directory concept.
This commit is contained in:
@@ -343,6 +343,9 @@ public:
|
||||
// get all files used by this db (if any)
|
||||
virtual std::vector<std::string> get_filenames() const = 0;
|
||||
|
||||
// return the name of the folder the db's file(s) should reside in
|
||||
virtual std::string get_db_name() const = 0;
|
||||
|
||||
|
||||
// FIXME: these are just for functionality mocking, need to implement
|
||||
// RAII-friendly and multi-read one-write friendly locking mechanism
|
||||
|
||||
@@ -775,6 +775,13 @@ std::vector<std::string> BlockchainLMDB::get_filenames() const
|
||||
return filenames;
|
||||
}
|
||||
|
||||
std::string BlockchainLMDB::get_db_name() const
|
||||
{
|
||||
LOG_PRINT_L3("BlockchainLMDB::" << __func__);
|
||||
|
||||
return std::string("lmdb");
|
||||
}
|
||||
|
||||
// TODO: this?
|
||||
bool BlockchainLMDB::lock()
|
||||
{
|
||||
|
||||
@@ -126,6 +126,8 @@ public:
|
||||
|
||||
virtual std::vector<std::string> get_filenames() const;
|
||||
|
||||
virtual std::string get_db_name() const;
|
||||
|
||||
virtual bool lock();
|
||||
|
||||
virtual void unlock();
|
||||
|
||||
Reference in New Issue
Block a user