add --regtest and --fixed-difficulty for regression testing
on_generateblocks RPC call combines functionality from the on_getblocktemplate and on_submitblock RPC calls to allow rapid block creation. Difficulty is set permanently to 1 for regtest. Makes use of FAKECHAIN network type, but takes hard fork heights from mainchain Default reserve_size in generate_blocks RPC call is now 1. If it is 0, the following error occurs 'Failed to calculate offset for'. Queries hard fork heights info of other network types
This commit is contained in:
@@ -1465,6 +1465,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__);
|
||||
|
||||
@@ -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