index, refactor: Rename ReverseBlock to RevertBlock
What changed, and why it matters
This commit simply renames a private internal function from 'ReverseBlock' to 'RevertBlock' because the new name better describes what the function does during blockchain reorganizations. No behavior, logic, or security properties change.
No security action needed; this is a non-functional rename.
Security signals we found
No strong security signals were identified.
Evidence from the diff
A pure refactor in the CoinStatsIndex class: the private method ReverseBlock is renamed to RevertBlock, and its single call site and declaration are updated accordingly. The comment above the implementation is also updated. There are no functional changes to code flow, data handling, or error handling.
Changed components
src/index/coinstatsindex.cppsrc/index/coinstatsindex.hInspect captured patch +4 / −4
diff --git a/src/index/coinstatsindex.cpp b/src/index/coinstatsindex.cpp
index 96693f7f..ce3f566d 100644
--- a/src/index/coinstatsindex.cpp
+++ b/src/index/coinstatsindex.cpp
@@ -265,7 +265,7 @@ bool CoinStatsIndex::CustomRemove(const interfaces::BlockInfo& block)
if (!m_db->WriteBatch(batch)) return false;
- if (!ReverseBlock(block)) {
+ if (!RevertBlock(block)) {
return false; // failure cause logged internally
}
@@ -381,8 +381,8 @@ interfaces::Chain::NotifyOptions CoinStatsIndex::CustomOptions()
return options;
}
-// Reverse a single block as part of a reorg
-bool CoinStatsIndex::ReverseBlock(const interfaces::BlockInfo& block)
+// Revert a single block as part of a reorg
+bool CoinStatsIndex::RevertBlock(const interfaces::BlockInfo& block)
{
std::pair<uint256, DBVal> read_out;
diff --git a/src/index/coinstatsindex.h b/src/index/coinstatsindex.h
index 6e274368..f2e95b44 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};
- [[nodiscard]] bool ReverseBlock(const interfaces::BlockInfo& block);
+ [[nodiscard]] bool RevertBlock(const interfaces::BlockInfo& block);
bool AllowPrune() const override { return true; }
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.