diff options
author | TheCharlatan <seb.kung@gmail.com> | 2023-07-25 11:12:10 +0200 |
---|---|---|
committer | TheCharlatan <seb.kung@gmail.com> | 2023-08-31 22:53:08 +0200 |
commit | 5671c15f4520c6dc20e0805fd0b06157ff94bcd7 (patch) | |
tree | ce702eac4ae89144f7aec33e1f114a2cb813e681 /src/node | |
parent | f4f1d6d230dd390f0524b8852b8cfc912d006958 (diff) |
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')
-rw-r--r-- | src/node/blockstorage.h | 2 |
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; |