static leveldb::Options GetOptions() {
leveldb::Options options;
- int nCacheSizeMB = GetArg("-dbcache", 25);
+ int nCacheSizeMB = GetArgInt("-dbcache", 25);
options.block_cache = leveldb::NewLRUCache(nCacheSizeMB * 1048576);
options.filter_policy = leveldb::NewBloomFilterPolicy(10);
return options;
filesystem::remove_all(directory); // remove directory
unsigned int nFile = 1;
- while (true)
+ for ( ; ; )
{
filesystem::path strBlockFile = GetDataDir() / strprintf("blk%04u.dat", nFile);
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;
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)