X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Ftxdb-leveldb.cpp;h=f68c53783d0f9eced3ecced260105c3deacac7eb;hb=9db337843422fcc97df8e3747a9828f6dc2395b5;hp=97bf88cc38886ab60ded34813f200aad33b8d1e5;hpb=31e9cb26642187e571f178ddcfa268ce7c4e56cc;p=novacoin.git diff --git a/src/txdb-leveldb.cpp b/src/txdb-leveldb.cpp index 97bf88c..f68c537 100644 --- a/src/txdb-leveldb.cpp +++ b/src/txdb-leveldb.cpp @@ -16,7 +16,7 @@ #include "kernel.h" #include "checkpoints.h" -#include "txdb.h" +#include "txdb-leveldb.h" #include "util.h" #include "main.h" @@ -35,27 +35,27 @@ static leveldb::Options GetOptions() { void init_blockindex(leveldb::Options& options, bool fRemoveOld = false) { // First time init. - filesystem::path directory = GetDataDir() / "txleveldb"; + boost::filesystem::path directory = GetDataDir() / "txleveldb"; if (fRemoveOld) { - filesystem::remove_all(directory); // remove directory + boost::filesystem::remove_all(directory); // remove directory unsigned int nFile = 1; - while (true) + for ( ; ; ) { - filesystem::path strBlockFile = GetDataDir() / strprintf("blk%04u.dat", nFile); + boost::filesystem::path strBlockFile = GetDataDir() / strprintf("blk%04u.dat", nFile); // Break if no such file - if( !filesystem::exists( strBlockFile ) ) + if( !boost::filesystem::exists( strBlockFile ) ) break; - filesystem::remove(strBlockFile); + boost::filesystem::remove(strBlockFile); nFile++; } } - filesystem::create_directory(directory); + boost::filesystem::create_directory(directory); printf("Opening LevelDB in %s\n", directory.string().c_str()); leveldb::Status status = leveldb::DB::Open(options, directory.string(), &txdb); if (!status.ok()) { @@ -64,7 +64,7 @@ void init_blockindex(leveldb::Options& options, bool fRemoveOld = false) { } // CDB subclasses are created and destroyed VERY OFTEN. That's why -// we shouldn't treat this as a free operations. +// we shouldn't treat this as free operations. CTxDB::CTxDB(const char* pszMode) { assert(pszMode);