It's a c++: use string.clear()
[novacoin.git] / src / txdb-leveldb.cpp
index 4a7a3cf..8f956fe 100644 (file)
@@ -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;