From 5671c15f4520c6dc20e0805fd0b06157ff94bcd7 Mon Sep 17 00:00:00 2001 From: TheCharlatan Date: Tue, 25 Jul 2023 11:12:10 +0200 Subject: [PATCH] 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. --- src/node/blockstorage.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;