mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
fuzz: explain package eval coin tracking better
This commit is contained in:
parent
bc0d98ea61
commit
c041ad6ecc
1 changed files with 4 additions and 2 deletions
|
@ -248,7 +248,8 @@ FUZZ_TARGET(ephemeral_package_eval, .init = initialize_tx_pool)
|
||||||
|
|
||||||
CAmount amount_in{0};
|
CAmount amount_in{0};
|
||||||
for (int i = 0; i < num_in; ++i) {
|
for (int i = 0; i < num_in; ++i) {
|
||||||
// Pop random outpoint
|
// Pop random outpoint. We erase them to avoid double-spending
|
||||||
|
// while in this loop, but later add them back (unless last_tx).
|
||||||
auto pop = outpoints.begin();
|
auto pop = outpoints.begin();
|
||||||
std::advance(pop, fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, outpoints.size() - 1));
|
std::advance(pop, fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, outpoints.size() - 1));
|
||||||
auto outpoint = *pop;
|
auto outpoint = *pop;
|
||||||
|
@ -405,7 +406,8 @@ FUZZ_TARGET(tx_package_eval, .init = initialize_tx_pool)
|
||||||
|
|
||||||
CAmount amount_in{0};
|
CAmount amount_in{0};
|
||||||
for (size_t i = 0; i < num_in; ++i) {
|
for (size_t i = 0; i < num_in; ++i) {
|
||||||
// Pop random outpoint
|
// Pop random outpoint. We erase them to avoid double-spending
|
||||||
|
// while in this loop, but later add them back (unless last_tx).
|
||||||
auto pop = outpoints.begin();
|
auto pop = outpoints.begin();
|
||||||
std::advance(pop, fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, outpoints.size() - 1));
|
std::advance(pop, fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, outpoints.size() - 1));
|
||||||
const auto outpoint = *pop;
|
const auto outpoint = *pop;
|
||||||
|
|
Loading…
Add table
Reference in a new issue