mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-03 17:54:19 +02:00
Merge bitcoin/bitcoin#34939: fuzz: Use CAmount for storing best_waste
890a09b1e4fuzz: Use CAmount for storing best_waste (Ava Chow) Pull request description: Waste is a CAmount, which is an int64_t. This will overflow an int, so `best_waste` should also be a `CAmount`. Fixes #34936 ACKs for top commit: murchandamus: ACK890a09b1e4furszy: ACK890a09b1e4Tree-SHA512: c6c4f530960f038675d4549c2285c6a4a828099a631486e317ec1215d89688ce109304654a95800978607c360c2ed34803523f5c56ebf7c2324ca095f87825b8
This commit is contained in:
@@ -275,7 +275,7 @@ FUZZ_TARGET(bnb_finds_min_waste)
|
||||
|
||||
// Brute force optimal solution (lowest waste, but cannot be superset of another solution)
|
||||
std::vector<uint32_t> solutions;
|
||||
int best_waste{std::numeric_limits<int>::max()};
|
||||
CAmount best_waste{std::numeric_limits<int64_t>::max()};
|
||||
int best_weight{std::numeric_limits<int>::max()};
|
||||
for (uint32_t pattern = 1; (pattern >> num_groups) == 0; ++pattern) {
|
||||
// BnB does not permit adding more inputs to a solution, i.e. a superset of a solution cannot ever be a solution.
|
||||
|
||||
Reference in New Issue
Block a user