X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Ftxdb-leveldb.cpp;h=8f956fe16413c5c6f29a3414706fe2401265bf14;hb=23a855ef6994d764ac7bf484f604ff45de5dae28;hp=4a7a3cfcee45d70970ee8d5e907ef22f30a65fab;hpb=fe326c477b0b109819653dc2657495f867ff8616;p=novacoin.git diff --git a/src/txdb-leveldb.cpp b/src/txdb-leveldb.cpp index 4a7a3cf..8f956fe 100644 --- a/src/txdb-leveldb.cpp +++ b/src/txdb-leveldb.cpp @@ -41,7 +41,7 @@ void init_blockindex(leveldb::Options& options, bool fRemoveOld = false) { filesystem::remove_all(directory); // remove directory unsigned int nFile = 1; - while (true) + for ( ; ; ) { filesystem::path strBlockFile = GetDataDir() / strprintf("blk%04u.dat", nFile); @@ -325,7 +325,7 @@ static CBlockIndex *InsertBlockIndex(uint256 hash) return (*mi).second; // Create new - CBlockIndex* pindexNew = new CBlockIndex(); + CBlockIndex* pindexNew = new(nothrow) CBlockIndex(); if (!pindexNew) throw runtime_error("LoadBlockIndex() : new CBlockIndex failed"); mi = mapBlockIndex.insert(make_pair(hash, pindexNew)).first;