Merge pull request #3854
149da42db_lmdb: enable batch transactions by default (stoffu)34cb6b4add --regtest and --fixed-difficulty for regression testing (vicsn)9e1403eupdate get_info RPC and bump RPC version (vicsn)207b66efirst new functional tests (vicsn)
This commit is contained in:
@@ -1469,6 +1469,21 @@ std::vector<std::string> BlockchainLMDB::get_filenames() const
|
||||
return filenames;
|
||||
}
|
||||
|
||||
bool BlockchainLMDB::remove_data_file(const std::string& folder) const
|
||||
{
|
||||
const std::string filename = folder + "/data.mdb";
|
||||
try
|
||||
{
|
||||
boost::filesystem::remove(filename);
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
MERROR("Failed to remove " << filename << ": " << e.what());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string BlockchainLMDB::get_db_name() const
|
||||
{
|
||||
LOG_PRINT_L3("BlockchainLMDB::" << __func__);
|
||||
|
||||
@@ -166,7 +166,7 @@ struct mdb_txn_safe
|
||||
class BlockchainLMDB : public BlockchainDB
|
||||
{
|
||||
public:
|
||||
BlockchainLMDB(bool batch_transactions=false);
|
||||
BlockchainLMDB(bool batch_transactions=true);
|
||||
~BlockchainLMDB();
|
||||
|
||||
virtual void open(const std::string& filename, const int mdb_flags=0);
|
||||
@@ -181,6 +181,8 @@ public:
|
||||
|
||||
virtual std::vector<std::string> get_filenames() const;
|
||||
|
||||
virtual bool remove_data_file(const std::string& folder) const;
|
||||
|
||||
virtual std::string get_db_name() const;
|
||||
|
||||
virtual bool lock();
|
||||
|
||||
Reference in New Issue
Block a user