Skip to content

Commit 5671c15

Browse files
committed
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.
1 parent f4f1d6d commit 5671c15

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/node/blockstorage.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class BlockManager
9393
EXCLUSIVE_LOCKS_REQUIRED(cs_main);
9494
void FlushBlockFile(bool fFinalize = false, bool finalize_undo = false);
9595
void FlushUndoFile(int block_file, bool finalize = false);
96-
bool FindBlockPos(FlatFilePos& pos, unsigned int nAddSize, unsigned int nHeight, uint64_t nTime, bool fKnown);
96+
[[nodiscard]] bool FindBlockPos(FlatFilePos& pos, unsigned int nAddSize, unsigned int nHeight, uint64_t nTime, bool fKnown);
9797
bool FindUndoPos(BlockValidationState& state, int nFile, FlatFilePos& pos, unsigned int nAddSize);
9898

9999
FlatFileSeq BlockFileSeq() const;

0 commit comments

Comments
 (0)