X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Ftxdb-bdb.cpp;h=1235125c821d95d1c35d08de4d3d50eade13f33c;hb=5a7a2125b6b4ed7d3ea55f333d0cf2345bd1d916;hp=416247c8f0884354e687120d476a9971ad5c40aa;hpb=aef688225365ca2a28238926104d98a228acfaa3;p=novacoin.git diff --git a/src/txdb-bdb.cpp b/src/txdb-bdb.cpp index 416247c..1235125 100644 --- a/src/txdb-bdb.cpp +++ b/src/txdb-bdb.cpp @@ -160,7 +160,7 @@ CBlockIndex static * 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; @@ -223,8 +223,8 @@ bool CTxDB::LoadBlockIndex() nBestInvalidTrust = bnBestInvalidTrust.getuint256(); // Verify blocks in the best chain - int nCheckLevel = GetArg("-checklevel", 1); - int nCheckDepth = GetArg( "-checkblocks", 2500); + int nCheckLevel = GetArgInt("-checklevel", 1); + int nCheckDepth = GetArgInt( "-checkblocks", 2500); if (nCheckDepth == 0) nCheckDepth = 1000000000; // suffices until the year 19000 if (nCheckDepth > nBestHeight) @@ -362,7 +362,7 @@ bool CTxDB::LoadBlockIndexGuts() // Load mapBlockIndex unsigned int fFlags = DB_SET_RANGE; - while (true) + for ( ; ; ) { // Read next record CDataStream ssKey(SER_DISK, CLIENT_VERSION);