streams: remove unused code

This commit is contained in:
Pieter Wuille committed 2024-09-19 07:33:02 -04:00
1 parent 2db926f49c
commit 67a3d59076
4 files changed
-16

No files matched your search

-8
View File
@@ -684,10 +684,6 @@ bool BlockManager::UndoWriteToDisk(const CBlockUndo& blockundo, FlatFilePos& pos
// Write undo data // Write undo data
long fileOutPos = fileout.tell(); long fileOutPos = fileout.tell();
if (fileOutPos < 0) {
LogError("%s: ftell failed\n", __func__);
return false;
}
pos.nPos = (unsigned int)fileOutPos; pos.nPos = (unsigned int)fileOutPos;
fileout << blockundo; fileout << blockundo;
@@ -982,10 +978,6 @@ bool BlockManager::WriteBlockToDisk(const CBlock& block, FlatFilePos& pos) const
// Write block // Write block
long fileOutPos = fileout.tell(); long fileOutPos = fileout.tell();
if (fileOutPos < 0) {
LogError("%s: ftell failed\n", __func__);
return false;
}
pos.nPos = (unsigned int)fileOutPos; pos.nPos = (unsigned int)fileOutPos;
fileout << TX_WITH_WITNESS(block); fileout << TX_WITH_WITNESS(block);
-2
View File
@@ -77,8 +77,6 @@ std::optional<uint256> ReadSnapshotBaseBlockhash(fs::path chaindir)
afile.seek(0, SEEK_END); afile.seek(0, SEEK_END);
if (position != afile.tell()) { if (position != afile.tell()) {
LogPrintf("[snapshot] warning: unexpected trailing data in %s\n", read_from_str); LogPrintf("[snapshot] warning: unexpected trailing data in %s\n", read_from_str);
} else if (afile.IsError()) {
LogPrintf("[snapshot] warning: i/o error reading %s\n", read_from_str);
} }
return base_blockhash; return base_blockhash;
} }
-5
View File
@@ -106,11 +106,6 @@ bool AutoFile::Commit()
return ::FileCommit(m_file); return ::FileCommit(m_file);
} }
bool AutoFile::IsError()
{
return ferror(m_file);
}
bool AutoFile::Truncate(unsigned size) bool AutoFile::Truncate(unsigned size)
{ {
return ::TruncateFile(m_file, size); return ::TruncateFile(m_file, size);
-1
View File
@@ -455,7 +455,6 @@ public:
} }
bool Commit(); bool Commit();
bool IsError();
bool Truncate(unsigned size); bool Truncate(unsigned size);
}; };