What changed, and why it matters
This commit removes an unnecessary std::move in a database write and adjusts a fuzz test variable to silence a clang-tidy warning. There is no security issue in the diff itself; it is a code-quality cleanup.
No security action required. Treat as normal code-quality/maintenance commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change in src/index/coinstatsindex.cpp removes std::move around value.second because batch.Write takes a const reference, making the move both unnecessary and flagged by clang-tidy. The fuzz test change captures only the hashSerialized field instead of copying the whole utxo_stats struct, which appears intended to address a clang-tidy false positive. Neither change alters program semantics in a security-relevant way.
Changed components
src/index/coinstatsindex.cppsrc/test/fuzz/utxo_total_supply.cppInspect captured patch +3 / −3
diff --git a/src/index/coinstatsindex.cpp b/src/index/coinstatsindex.cpp
index 3d092254..af798e29 100644
--- a/src/index/coinstatsindex.cpp
+++ b/src/index/coinstatsindex.cpp
@@ -256,7 +256,7 @@ bool CoinStatsIndex::CustomAppend(const interfaces::BlockInfo& block)
return false;
}
- batch.Write(DBHashKey(value.first), std::move(value.second));
+ batch.Write(DBHashKey(value.first), value.second);
return true;
}
diff --git a/src/test/fuzz/utxo_total_supply.cpp b/src/test/fuzz/utxo_total_supply.cpp
index d9382ca8..1348962a 100644
--- a/src/test/fuzz/utxo_total_supply.cpp
+++ b/src/test/fuzz/utxo_total_supply.cpp
@@ -153,7 +153,7 @@ FUZZ_TARGET(utxo_total_supply)
node::RegenerateCommitments(*current_block, chainman);
const bool was_valid = !MineBlock(node, current_block).IsNull();
- const auto prev_utxo_stats = utxo_stats;
+ const uint256 prev_hash_serialized{utxo_stats.hashSerialized};
if (was_valid) {
if (duplicate_coinbase_height == ActiveHeight()) {
// we mined the duplicate coinbase
@@ -167,7 +167,7 @@ FUZZ_TARGET(utxo_total_supply)
if (!was_valid) {
// utxo stats must not change
- assert(prev_utxo_stats.hashSerialized == utxo_stats.hashSerialized);
+ assert(prev_hash_serialized == utxo_stats.hashSerialized);
}
current_block = PrepareNextBlock();
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.