aboutsummaryrefslogtreecommitdiff
path: root/src/index
diff options
context:
space:
mode:
authorMacroFake <falke.marco@gmail.com>2022-06-06 17:22:59 +0200
committerMacroFake <falke.marco@gmail.com>2022-06-29 10:33:13 +0200
commitfacc2fa7b8a218a0df6a19772e1641ea68dda2e3 (patch)
treec2e5cf39dd2c0b88517a8bb2a83d7ca2bba2c360 /src/index
parent6666803c897e4ad27b45cb74e3a9aa74a335f1bf (diff)
downloadbitcoin-facc2fa7b8a218a0df6a19772e1641ea68dda2e3.tar.xz
Use AutoFile where possible
Diffstat (limited to 'src/index')
-rw-r--r--src/index/blockfilterindex.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/index/blockfilterindex.cpp b/src/index/blockfilterindex.cpp
index c92b8c7e19..bc44a90c0e 100644
--- a/src/index/blockfilterindex.cpp
+++ b/src/index/blockfilterindex.cpp
@@ -131,7 +131,7 @@ bool BlockFilterIndex::CommitInternal(CDBBatch& batch)
const FlatFilePos& pos = m_next_filter_pos;
// Flush current filter file to disk.
- CAutoFile file(m_filter_fileseq->Open(pos), SER_DISK, CLIENT_VERSION);
+ AutoFile file{m_filter_fileseq->Open(pos)};
if (file.IsNull()) {
return error("%s: Failed to open filter file %d", __func__, pos.nFile);
}
@@ -145,7 +145,7 @@ bool BlockFilterIndex::CommitInternal(CDBBatch& batch)
bool BlockFilterIndex::ReadFilterFromDisk(const FlatFilePos& pos, BlockFilter& filter) const
{
- CAutoFile filein(m_filter_fileseq->Open(pos, true), SER_DISK, CLIENT_VERSION);
+ AutoFile filein{m_filter_fileseq->Open(pos, true)};
if (filein.IsNull()) {
return false;
}
@@ -173,7 +173,7 @@ size_t BlockFilterIndex::WriteFilterToDisk(FlatFilePos& pos, const BlockFilter&
// If writing the filter would overflow the file, flush and move to the next one.
if (pos.nPos + data_size > MAX_FLTR_FILE_SIZE) {
- CAutoFile last_file(m_filter_fileseq->Open(pos), SER_DISK, CLIENT_VERSION);
+ AutoFile last_file{m_filter_fileseq->Open(pos)};
if (last_file.IsNull()) {
LogPrintf("%s: Failed to open filter file %d\n", __func__, pos.nFile);
return 0;
@@ -199,7 +199,7 @@ size_t BlockFilterIndex::WriteFilterToDisk(FlatFilePos& pos, const BlockFilter&
return 0;
}
- CAutoFile fileout(m_filter_fileseq->Open(pos), SER_DISK, CLIENT_VERSION);
+ AutoFile fileout{m_filter_fileseq->Open(pos)};
if (fileout.IsNull()) {
LogPrintf("%s: Failed to open filter file %d\n", __func__, pos.nFile);
return 0;