What changed, and why it matters
This is a minor code cleanup in a benchmark file. It changes a function parameter type from signed to unsigned to match how it is actually used, and removes a duplicated comment. It does not affect the live Bitcoin wallet or network code and has no security relevance.
No security action needed. This is a routine benchmark maintenance commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies src/bench/coin_selection.cpp. It changes add_coin’s nInput parameter from int to uint32_t, which aligns with COutPoint’s n index type. It also removes redundant ‘Copied from…’ comments and adjusts whitespace. This is a benchmark-only change with no functional change to production coin selection logic.
Changed components
src/bench/coin_selection.cppInspect captured patch +3 / −4
diff --git a/src/bench/coin_selection.cpp b/src/bench/coin_selection.cpp
index 9f0bf2cc..28a8ca8e 100644
--- a/src/bench/coin_selection.cpp
+++ b/src/bench/coin_selection.cpp
@@ -88,17 +88,16 @@ static void CoinSelection(benchmark::Bench& bench)
});
}
-// Copied from src/wallet/test/coinselector_tests.cpp
-static void add_coin(const CAmount& nValue, int nInput, std::vector<OutputGroup>& set)
+static void add_coin(const CAmount& nValue, uint32_t nInput, std::vector<OutputGroup>& set)
{
CMutableTransaction tx;
tx.vout.resize(nInput + 1);
tx.vout[nInput].nValue = nValue;
COutput output(COutPoint(tx.GetHash(), nInput), tx.vout.at(nInput), /*depth=*/0, /*input_bytes=*/-1, /*solvable=*/true, /*safe=*/true, /*time=*/0, /*from_me=*/true, /*fees=*/0);
set.emplace_back();
- set.back().Insert(std::make_shared<COutput>(output), /*ancestors=*/ 0, /*cluster_count=*/ 0);
+ set.back().Insert(std::make_shared<COutput>(output), /*ancestors=*/0, /*cluster_count=*/0);
}
-// Copied from src/wallet/test/coinselector_tests.cpp
+
static CAmount make_hard_case(int utxos, std::vector<OutputGroup>& utxo_pool)
{
utxo_pool.clear();
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.