|
|
@ -1106,7 +1106,7 @@ bool WriteBlockToDisk(CBlock& block, CDiskBlockPos& pos) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Open history file to append
|
|
|
|
// Open history file to append
|
|
|
|
CAutoFile fileout(OpenBlockFile(pos), SER_DISK, CLIENT_VERSION); |
|
|
|
CAutoFile fileout(OpenBlockFile(pos), SER_DISK, CLIENT_VERSION); |
|
|
|
if (!fileout) |
|
|
|
if (fileout.IsNull()) |
|
|
|
return error("WriteBlockToDisk : OpenBlockFile failed"); |
|
|
|
return error("WriteBlockToDisk : OpenBlockFile failed"); |
|
|
|
|
|
|
|
|
|
|
|
// Write index header
|
|
|
|
// Write index header
|
|
|
@ -1134,7 +1134,7 @@ bool ReadBlockFromDisk(CBlock& block, const CDiskBlockPos& pos) |
|
|
|
|
|
|
|
|
|
|
|
// Open history file to read
|
|
|
|
// Open history file to read
|
|
|
|
CAutoFile filein(OpenBlockFile(pos, true), SER_DISK, CLIENT_VERSION); |
|
|
|
CAutoFile filein(OpenBlockFile(pos, true), SER_DISK, CLIENT_VERSION); |
|
|
|
if (!filein) |
|
|
|
if (filein.IsNull()) |
|
|
|
return error("ReadBlockFromDisk : OpenBlockFile failed"); |
|
|
|
return error("ReadBlockFromDisk : OpenBlockFile failed"); |
|
|
|
|
|
|
|
|
|
|
|
// Read block
|
|
|
|
// Read block
|
|
|
@ -4548,7 +4548,7 @@ bool CBlockUndo::WriteToDisk(CDiskBlockPos &pos, const uint256 &hashBlock) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Open history file to append
|
|
|
|
// Open history file to append
|
|
|
|
CAutoFile fileout(OpenUndoFile(pos), SER_DISK, CLIENT_VERSION); |
|
|
|
CAutoFile fileout(OpenUndoFile(pos), SER_DISK, CLIENT_VERSION); |
|
|
|
if (!fileout) |
|
|
|
if (fileout.IsNull()) |
|
|
|
return error("CBlockUndo::WriteToDisk : OpenUndoFile failed"); |
|
|
|
return error("CBlockUndo::WriteToDisk : OpenUndoFile failed"); |
|
|
|
|
|
|
|
|
|
|
|
// Write index header
|
|
|
|
// Write index header
|
|
|
@ -4580,7 +4580,7 @@ bool CBlockUndo::ReadFromDisk(const CDiskBlockPos &pos, const uint256 &hashBlock |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Open history file to read
|
|
|
|
// Open history file to read
|
|
|
|
CAutoFile filein(OpenUndoFile(pos, true), SER_DISK, CLIENT_VERSION); |
|
|
|
CAutoFile filein(OpenUndoFile(pos, true), SER_DISK, CLIENT_VERSION); |
|
|
|
if (!filein) |
|
|
|
if (filein.IsNull()) |
|
|
|
return error("CBlockUndo::ReadFromDisk : OpenBlockFile failed"); |
|
|
|
return error("CBlockUndo::ReadFromDisk : OpenBlockFile failed"); |
|
|
|
|
|
|
|
|
|
|
|
// Read block
|
|
|
|
// Read block
|
|
|
|