some small fixes for main.cpp/.h
- remove an unwanted ";" at the end of the ~CCoinsView() destructor - in FindBlockPos() and FindUndoPos() only call fclose(), is file is open - fix an error string in the CBlockUndo class
This commit is contained in:
parent
e12efb9d33
commit
13e5cce4c3
@ -1899,10 +1899,10 @@ bool FindBlockPos(CDiskBlockPos &pos, unsigned int nAddSize, unsigned int nHeigh
|
|||||||
if (file) {
|
if (file) {
|
||||||
printf("Pre-allocating up to position 0x%x in blk%05u.dat\n", nNewChunks * BLOCKFILE_CHUNK_SIZE, pos.nFile);
|
printf("Pre-allocating up to position 0x%x in blk%05u.dat\n", nNewChunks * BLOCKFILE_CHUNK_SIZE, pos.nFile);
|
||||||
AllocateFileRange(file, pos.nPos, nNewChunks * BLOCKFILE_CHUNK_SIZE - pos.nPos);
|
AllocateFileRange(file, pos.nPos, nNewChunks * BLOCKFILE_CHUNK_SIZE - pos.nPos);
|
||||||
}
|
|
||||||
fclose(file);
|
fclose(file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!pblocktree->WriteBlockFileInfo(nLastBlockFile, infoLastBlockFile))
|
if (!pblocktree->WriteBlockFileInfo(nLastBlockFile, infoLastBlockFile))
|
||||||
return error("FindBlockPos() : cannot write updated block info");
|
return error("FindBlockPos() : cannot write updated block info");
|
||||||
@ -1941,9 +1941,9 @@ bool FindUndoPos(int nFile, CDiskBlockPos &pos, unsigned int nAddSize)
|
|||||||
if (file) {
|
if (file) {
|
||||||
printf("Pre-allocating up to position 0x%x in rev%05u.dat\n", nNewChunks * UNDOFILE_CHUNK_SIZE, pos.nFile);
|
printf("Pre-allocating up to position 0x%x in rev%05u.dat\n", nNewChunks * UNDOFILE_CHUNK_SIZE, pos.nFile);
|
||||||
AllocateFileRange(file, pos.nPos, nNewChunks * UNDOFILE_CHUNK_SIZE - pos.nPos);
|
AllocateFileRange(file, pos.nPos, nNewChunks * UNDOFILE_CHUNK_SIZE - pos.nPos);
|
||||||
}
|
|
||||||
fclose(file);
|
fclose(file);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -733,7 +733,6 @@ public:
|
|||||||
|
|
||||||
bool WriteToDisk(CDiskBlockPos &pos)
|
bool WriteToDisk(CDiskBlockPos &pos)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Open history file to append
|
// Open history file to append
|
||||||
CAutoFile fileout = CAutoFile(OpenUndoFile(pos), SER_DISK, CLIENT_VERSION);
|
CAutoFile fileout = CAutoFile(OpenUndoFile(pos), SER_DISK, CLIENT_VERSION);
|
||||||
if (!fileout)
|
if (!fileout)
|
||||||
@ -746,7 +745,7 @@ public:
|
|||||||
// Write undo data
|
// Write undo data
|
||||||
long fileOutPos = ftell(fileout);
|
long fileOutPos = ftell(fileout);
|
||||||
if (fileOutPos < 0)
|
if (fileOutPos < 0)
|
||||||
return error("CBlock::WriteToDisk() : ftell failed");
|
return error("CBlockUndo::WriteToDisk() : ftell failed");
|
||||||
pos.nPos = (unsigned int)fileOutPos;
|
pos.nPos = (unsigned int)fileOutPos;
|
||||||
fileout << *this;
|
fileout << *this;
|
||||||
|
|
||||||
@ -757,7 +756,6 @@ public:
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/** pruned version of CTransaction: only retains metadata and unspent transaction outputs
|
/** pruned version of CTransaction: only retains metadata and unspent transaction outputs
|
||||||
@ -1872,7 +1870,7 @@ public:
|
|||||||
virtual bool GetStats(CCoinsStats &stats);
|
virtual bool GetStats(CCoinsStats &stats);
|
||||||
|
|
||||||
// As we use CCoinsViews polymorphically, have a virtual destructor
|
// As we use CCoinsViews polymorphically, have a virtual destructor
|
||||||
virtual ~CCoinsView() {};
|
virtual ~CCoinsView() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** CCoinsView backed by another CCoinsView */
|
/** CCoinsView backed by another CCoinsView */
|
||||||
|
Loading…
Reference in New Issue
Block a user