mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-12 13:42:10 +02:00
6ee05c4b18test: wallet: BnB incomplete result on attempt-limit success (Bruno Garcia) Pull request description: BnB can return a valid selection before exhausting the search tree, then hit `TOTAL_TRIES` while continuing to look for a better one. Add a unit test for that path using a known exhaustion fixture plus an exact-match coin, and assert the result is marked incomplete via `GetAlgoCompleted() == false`. It kills the following mutant: ```diff diff --git a/src/wallet/coinselection.cpp b/src/wallet/coinselection.cpp index 8d69957c30..e4d07415f3 100644 --- a/src/wallet/coinselection.cpp +++ b/src/wallet/coinselection.cpp @@ -212,7 +212,7 @@ util::Result<SelectionResult> SelectCoinsBnB(std::vector<OutputGroup>& utxo_pool if (curr_try >= TOTAL_TRIES) { // Solution is not guaranteed to be optimal if `curr_try` hit TOTAL_TRIES - result.SetAlgoCompleted(false); + result.SetAlgoCompleted(true); break; } ``` ACKs for top commit: yashbhutwala: tACK6ee05c4b18achow101: ACK6ee05c4b18murchandamus: ACK6ee05c4b18Tree-SHA512: 32d0cc6da7586abdd195b87459da0a6ebbdcf8115bef41f5e625864bfa9ce8231a58f8d4b61708279ebeaef372e4f3b5fb18eab28a01dad53f043ba083330b3d