mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 23:07:59 +01:00
fuzz: Add more invariant checks for package_rbf
This commit is contained in:
parent
2a3ada8b21
commit
b684d82d7e
1 changed files with 12 additions and 1 deletions
|
@ -178,5 +178,16 @@ FUZZ_TARGET(package_rbf, .init = initialize_package_rbf)
|
|||
|
||||
// If internals report error, wrapper should too
|
||||
auto err_tuple{ImprovesFeerateDiagram(pool, direct_conflicts, all_conflicts, replacement_fees, replacement_vsize)};
|
||||
if (!calc_results.has_value()) assert(err_tuple.value().first == DiagramCheckError::UNCALCULABLE);
|
||||
if (!calc_results.has_value()) {
|
||||
assert(err_tuple.value().first == DiagramCheckError::UNCALCULABLE);
|
||||
} else {
|
||||
// Diagram check succeeded
|
||||
if (!err_tuple.has_value()) {
|
||||
// New diagram's final fee should always match or exceed old diagram's
|
||||
assert(calc_results->first.back().fee <= calc_results->second.back().fee);
|
||||
} else if (calc_results->first.back().fee > calc_results->second.back().fee) {
|
||||
// Or it failed, and if old diagram had higher fees, it should be a failure
|
||||
assert(err_tuple.value().first == DiagramCheckError::FAILURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue