Skip to content

Commit c0bf667

Browse files
committed
index: add [nodiscard] attribute to functions writing to the db
1 parent eef5955 commit c0bf667

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/index/blockfilterindex.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ bool BlockFilterIndex::CustomAppend(const interfaces::BlockInfo& block)
260260
return true;
261261
}
262262

263-
static bool CopyHeightIndexToHashIndex(CDBIterator& db_it, CDBBatch& batch,
263+
[[nodiscard]] static bool CopyHeightIndexToHashIndex(CDBIterator& db_it, CDBBatch& batch,
264264
const std::string& index_name,
265265
int start_height, int stop_height)
266266
{

src/index/coinstatsindex.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ bool CoinStatsIndex::CustomAppend(const interfaces::BlockInfo& block)
235235
return m_db->Write(DBHeightKey(block.height), value);
236236
}
237237

238-
static bool CopyHeightIndexToHashIndex(CDBIterator& db_it, CDBBatch& batch,
238+
[[nodiscard]] static bool CopyHeightIndexToHashIndex(CDBIterator& db_it, CDBBatch& batch,
239239
const std::string& index_name,
240240
int start_height, int stop_height)
241241
{

src/index/coinstatsindex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class CoinStatsIndex final : public BaseIndex
3838
CAmount m_total_unspendables_scripts{0};
3939
CAmount m_total_unspendables_unclaimed_rewards{0};
4040

41-
bool ReverseBlock(const CBlock& block, const CBlockIndex* pindex);
41+
[[nodiscard]] bool ReverseBlock(const CBlock& block, const CBlockIndex* pindex);
4242

4343
bool AllowPrune() const override { return true; }
4444

src/index/txindex.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class TxIndex::DB : public BaseIndex::DB
2626
bool ReadTxPos(const uint256& txid, CDiskTxPos& pos) const;
2727

2828
/// Write a batch of transaction positions to the DB.
29-
bool WriteTxs(const std::vector<std::pair<uint256, CDiskTxPos>>& v_pos);
29+
[[nodiscard]] bool WriteTxs(const std::vector<std::pair<uint256, CDiskTxPos>>& v_pos);
3030
};
3131

3232
TxIndex::DB::DB(size_t n_cache_size, bool f_memory, bool f_wipe) :

0 commit comments

Comments
 (0)