aboutsummaryrefslogtreecommitdiff
path: root/src/node/blockstorage.h
diff options
context:
space:
mode:
authorTheCharlatan <seb.kung@gmail.com>2023-07-25 11:12:10 +0200
committerTheCharlatan <seb.kung@gmail.com>2023-08-31 22:53:08 +0200
commit5671c15f4520c6dc20e0805fd0b06157ff94bcd7 (patch)
treece702eac4ae89144f7aec33e1f114a2cb813e681 /src/node/blockstorage.h
parentf4f1d6d230dd390f0524b8852b8cfc912d006958 (diff)
downloadbitcoin-5671c15f4520c6dc20e0805fd0b06157ff94bcd7.tar.xz
blockstorage: Mark FindBlockPos as nodiscard
A false return value indicates a fatal error (disk space being too low), so make sure we always consume this error code. This commit is part of an ongoing process for making the handling of fatal errors more transparent and easier to understand.
Diffstat (limited to 'src/node/blockstorage.h')
-rw-r--r--src/node/blockstorage.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/node/blockstorage.h b/src/node/blockstorage.h
index eb40d45aba..0e8b9abce9 100644
--- a/src/node/blockstorage.h
+++ b/src/node/blockstorage.h
@@ -93,7 +93,7 @@ private:
EXCLUSIVE_LOCKS_REQUIRED(cs_main);
void FlushBlockFile(bool fFinalize = false, bool finalize_undo = false);
void FlushUndoFile(int block_file, bool finalize = false);
- bool FindBlockPos(FlatFilePos& pos, unsigned int nAddSize, unsigned int nHeight, uint64_t nTime, bool fKnown);
+ [[nodiscard]] bool FindBlockPos(FlatFilePos& pos, unsigned int nAddSize, unsigned int nHeight, uint64_t nTime, bool fKnown);
bool FindUndoPos(BlockValidationState& state, int nFile, FlatFilePos& pos, unsigned int nAddSize);
FlatFileSeq BlockFileSeq() const;