aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfurszy <matiasfurszyfer@protonmail.com>2023-09-08 10:04:14 -0300
committerfurszy <matiasfurszyfer@protonmail.com>2023-09-08 10:04:14 -0300
commitc0bf667912064960df194ea94150976b34f7c267 (patch)
tree43cd477c4ace8a5f769b87295163109e558faad4
parenteef595560e9ecf3a0d1db4d8ea7ecc33a49d839f (diff)
downloadbitcoin-c0bf667912064960df194ea94150976b34f7c267.tar.xz
index: add [nodiscard] attribute to functions writing to the db
-rw-r--r--src/index/blockfilterindex.cpp2
-rw-r--r--src/index/coinstatsindex.cpp2
-rw-r--r--src/index/coinstatsindex.h2
-rw-r--r--src/index/txindex.cpp2
4 files changed, 4 insertions, 4 deletions
diff --git a/src/index/blockfilterindex.cpp b/src/index/blockfilterindex.cpp
index b23d66ac1d..ef3ec10506 100644
--- a/src/index/blockfilterindex.cpp
+++ b/src/index/blockfilterindex.cpp
@@ -260,7 +260,7 @@ bool BlockFilterIndex::CustomAppend(const interfaces::BlockInfo& block)
return true;
}
-static bool CopyHeightIndexToHashIndex(CDBIterator& db_it, CDBBatch& batch,
+[[nodiscard]] static bool CopyHeightIndexToHashIndex(CDBIterator& db_it, CDBBatch& batch,
const std::string& index_name,
int start_height, int stop_height)
{
diff --git a/src/index/coinstatsindex.cpp b/src/index/coinstatsindex.cpp
index 30a4d52a34..9dab8ca901 100644
--- a/src/index/coinstatsindex.cpp
+++ b/src/index/coinstatsindex.cpp
@@ -235,7 +235,7 @@ bool CoinStatsIndex::CustomAppend(const interfaces::BlockInfo& block)
return m_db->Write(DBHeightKey(block.height), value);
}
-static bool CopyHeightIndexToHashIndex(CDBIterator& db_it, CDBBatch& batch,
+[[nodiscard]] static bool CopyHeightIndexToHashIndex(CDBIterator& db_it, CDBBatch& batch,
const std::string& index_name,
int start_height, int stop_height)
{
diff --git a/src/index/coinstatsindex.h b/src/index/coinstatsindex.h
index 21ce4c4767..d6322bfa7c 100644
--- a/src/index/coinstatsindex.h
+++ b/src/index/coinstatsindex.h
@@ -38,7 +38,7 @@ private:
CAmount m_total_unspendables_scripts{0};
CAmount m_total_unspendables_unclaimed_rewards{0};
- bool ReverseBlock(const CBlock& block, const CBlockIndex* pindex);
+ [[nodiscard]] bool ReverseBlock(const CBlock& block, const CBlockIndex* pindex);
bool AllowPrune() const override { return true; }
diff --git a/src/index/txindex.cpp b/src/index/txindex.cpp
index 2e07a35d0d..a41e6175cc 100644
--- a/src/index/txindex.cpp
+++ b/src/index/txindex.cpp
@@ -26,7 +26,7 @@ public:
bool ReadTxPos(const uint256& txid, CDiskTxPos& pos) const;
/// Write a batch of transaction positions to the DB.
- bool WriteTxs(const std::vector<std::pair<uint256, CDiskTxPos>>& v_pos);
+ [[nodiscard]] bool WriteTxs(const std::vector<std::pair<uint256, CDiskTxPos>>& v_pos);
};
TxIndex::DB::DB(size_t n_cache_size, bool f_memory, bool f_wipe) :