aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPieter Wuille <pieter@wuille.net>2024-09-19 07:29:12 -0400
committerPieter Wuille <pieter@wuille.net>2024-09-19 07:33:02 -0400
commit67a3d590768301fb46a93fdb0a5c66c0c2de1082 (patch)
treeed0fe237e02c4bdb84843697406b8317b019ea9b
parent2db926f49c812a3f04a565834c841ce4bc4ae288 (diff)
downloadbitcoin-67a3d590768301fb46a93fdb0a5c66c0c2de1082.tar.xz
streams: remove unused code
-rw-r--r--src/node/blockstorage.cpp8
-rw-r--r--src/node/utxo_snapshot.cpp2
-rw-r--r--src/streams.cpp5
-rw-r--r--src/streams.h1
4 files changed, 0 insertions, 16 deletions
diff --git a/src/node/blockstorage.cpp b/src/node/blockstorage.cpp
index 44c2808c3b..07878a5602 100644
--- a/src/node/blockstorage.cpp
+++ b/src/node/blockstorage.cpp
@@ -684,10 +684,6 @@ bool BlockManager::UndoWriteToDisk(const CBlockUndo& blockundo, FlatFilePos& pos
// Write undo data
long fileOutPos = fileout.tell();
- if (fileOutPos < 0) {
- LogError("%s: ftell failed\n", __func__);
- return false;
- }
pos.nPos = (unsigned int)fileOutPos;
fileout << blockundo;
@@ -982,10 +978,6 @@ bool BlockManager::WriteBlockToDisk(const CBlock& block, FlatFilePos& pos) const
// Write block
long fileOutPos = fileout.tell();
- if (fileOutPos < 0) {
- LogError("%s: ftell failed\n", __func__);
- return false;
- }
pos.nPos = (unsigned int)fileOutPos;
fileout << TX_WITH_WITNESS(block);
diff --git a/src/node/utxo_snapshot.cpp b/src/node/utxo_snapshot.cpp
index 7d589c886b..ca5491bdc2 100644
--- a/src/node/utxo_snapshot.cpp
+++ b/src/node/utxo_snapshot.cpp
@@ -77,8 +77,6 @@ std::optional<uint256> ReadSnapshotBaseBlockhash(fs::path chaindir)
afile.seek(0, SEEK_END);
if (position != afile.tell()) {
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;
}
diff --git a/src/streams.cpp b/src/streams.cpp
index 5f7baf92b9..baa5ad7abe 100644
--- a/src/streams.cpp
+++ b/src/streams.cpp
@@ -106,11 +106,6 @@ bool AutoFile::Commit()
return ::FileCommit(m_file);
}
-bool AutoFile::IsError()
-{
- return ferror(m_file);
-}
-
bool AutoFile::Truncate(unsigned size)
{
return ::TruncateFile(m_file, size);
diff --git a/src/streams.h b/src/streams.h
index 431a4d77c6..8a5af68dee 100644
--- a/src/streams.h
+++ b/src/streams.h
@@ -455,7 +455,6 @@ public:
}
bool Commit();
- bool IsError();
bool Truncate(unsigned size);
};