This commit is contained in:
jl777
2018-04-17 14:22:49 +03:00
parent ef645efa86
commit 0e32bd33e6
2 changed files with 8 additions and 6 deletions

View File

@@ -4181,7 +4181,7 @@ bool TestBlockValidity(CValidationState &state, const CBlock& block, CBlockIndex
}
if (!ContextualCheckBlock(block, state, pindexPrev))
{
fprintf(stderr,"TestBlockValidity failure C\n");
//fprintf(stderr,"TestBlockValidity failure C\n");
return false;
}
if (!ConnectBlock(block, state, &indexDummy, viewNew, true,fCheckPOW))
@@ -4313,7 +4313,7 @@ bool CheckDiskSpace(uint64_t nAdditionalBytes)
FILE* OpenDiskFile(const CDiskBlockPos &pos, const char *prefix, bool fReadOnly)
{
static int32_t didinit[1000]; long fsize,fpos; int32_t incr = 16*1024*1024;
static int32_t didinit[64]; long fsize,fpos; int32_t incr = 16*1024*1024;
if (pos.IsNull())
return NULL;
boost::filesystem::path path = GetBlockPosFilename(pos, prefix);
@@ -4336,10 +4336,10 @@ FILE* OpenDiskFile(const CDiskBlockPos &pos, const char *prefix, bool fReadOnly)
if ( ignore != 0 )
{
rewind(file);
while ( fread(ignore,1,incr,file) == incr )
while ( fread(ignore,1,incr,file) == incr ) // prefetch
fprintf(stderr,".");
free(ignore);
fprintf(stderr,"blk.%d loaded %ld bytes set fpos.%ld loading.%d\n",(int)pos.nFile,(long)ftell(file),(long)fpos,KOMODO_LOADINGBLOCKS);
// fprintf(stderr,"blk.%d loaded %ld bytes set fpos.%ld loading.%d\n",(int)pos.nFile,(long)ftell(file),(long)fpos,KOMODO_LOADINGBLOCKS);
}
}
fseek(file,fpos,SEEK_SET);
@@ -4583,6 +4583,7 @@ bool CVerifyDB::VerifyDB(CCoinsView *coinsview, int nCheckLevel, int nCheckDepth
CValidationState state;
// No need to verify JoinSplits twice
auto verifier = libzcash::ProofVerifier::Disabled();
fprintf(stderr,"start VerifyDB %u\n",(uint32_t)time(NULL));
for (CBlockIndex* pindex = chainActive.Tip(); pindex && pindex->pprev; pindex = pindex->pprev)
{
boost::this_thread::interruption_point();
@@ -4620,6 +4621,7 @@ bool CVerifyDB::VerifyDB(CCoinsView *coinsview, int nCheckLevel, int nCheckDepth
if (ShutdownRequested())
return true;
}
fprintf(stderr,"end VerifyDB %u\n",(uint32_t)time(NULL));
if (pindexFailure)
return error("VerifyDB(): *** coin database inconsistencies found (last %i blocks, %i good transactions before that)\n", chainActive.Height() - pindexFailure->nHeight + 1, nGoodTransactions);
@@ -4891,7 +4893,7 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp)
try {
// This takes over fileIn and calls fclose() on it in the CBufferedFile destructor
//CBufferedFile blkdat(fileIn, 2*MAX_BLOCK_SIZE, MAX_BLOCK_SIZE+8, SER_DISK, CLIENT_VERSION);
CBufferedFile blkdat(fileIn, 256*MAX_BLOCK_SIZE, MAX_BLOCK_SIZE+8, SER_DISK, CLIENT_VERSION);
CBufferedFile blkdat(fileIn, 32*MAX_BLOCK_SIZE, MAX_BLOCK_SIZE+8, SER_DISK, CLIENT_VERSION);
uint64_t nRewind = blkdat.GetPos();
while (!blkdat.eof()) {
boost::this_thread::interruption_point();