mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Allow LevelDB and SQLite to co-exist in the build and have the backing
store for hashed nodes selectable in the config.
This commit is contained in:
@@ -108,20 +108,23 @@ void Application::updateTables(bool ldbImport)
|
||||
addTxnSeqField();
|
||||
|
||||
#ifdef USE_LEVELDB
|
||||
boost::filesystem::path hashPath = theConfig.DATA_DIR / "hashnode.db";
|
||||
if (boost::filesystem::exists(hashPath))
|
||||
if (theApp->getHashedObjectStore().isLevelDB())
|
||||
{
|
||||
if (theConfig.LDB_IMPORT)
|
||||
boost::filesystem::path hashPath = theConfig.DATA_DIR / "hashnode.db";
|
||||
if (boost::filesystem::exists(hashPath))
|
||||
{
|
||||
Log(lsWARNING) << "Importing SQLite -> LevelDB";
|
||||
theApp->getHashedObjectStore().import(hashPath.string(), true);
|
||||
Log(lsWARNING) << "Remove or remname the hashnode.db file";
|
||||
}
|
||||
else
|
||||
{
|
||||
Log(lsWARNING) << "SQLite hashnode database exists. Please either remove or import";
|
||||
Log(lsWARNING) << "To import, start with the '--import' option. Otherwise, remove hashnode.db";
|
||||
exit(1);
|
||||
if (theConfig.LDB_IMPORT)
|
||||
{
|
||||
Log(lsWARNING) << "Importing SQLite -> LevelDB";
|
||||
theApp->getHashedObjectStore().import(hashPath.string(), true);
|
||||
Log(lsWARNING) << "Remove or remname the hashnode.db file";
|
||||
}
|
||||
else
|
||||
{
|
||||
Log(lsWARNING) << "SQLite hashnode database exists. Please either remove or import";
|
||||
Log(lsWARNING) << "To import, start with the '--import' option. Otherwise, remove hashnode.db";
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user