policy: remove constant parameter from IsWellFormedPackage

`IsWellFormedPackage()` already claims: "parents must appear before children."
In practice the `require_sorted` argument was always passed as `true`, making the false-path dead code.
It was introduced that way from the beginning in https://github.com/bitcoin/bitcoin/pull/28758/files#diff-f30090b30c9489972ee3f1181c302cf3a484bb890bade0fd7c9ca92ea8d347f6R79.

Remove the unused parameter, updating callers/tests.
This commit is contained in:
Lőrinc
2025-12-28 19:29:18 +02:00
parent 2bcb3f6464
commit 658d38106a
4 changed files with 14 additions and 14 deletions

View File

@@ -76,7 +76,7 @@ bool IsConsistentPackage(const Package& txns)
return true;
}
bool IsWellFormedPackage(const Package& txns, PackageValidationState& state, bool require_sorted)
bool IsWellFormedPackage(const Package& txns, PackageValidationState& state)
{
const unsigned int package_count = txns.size();
@@ -105,7 +105,7 @@ bool IsWellFormedPackage(const Package& txns, PackageValidationState& state, boo
// An unsorted package will fail anyway on missing-inputs, but it's better to quit earlier and
// fail on something less ambiguous (missing-inputs could also be an orphan or trying to
// spend nonexistent coins).
if (require_sorted && !IsTopoSortedPackage(txns, later_txids)) {
if (!IsTopoSortedPackage(txns, later_txids)) {
return state.Invalid(PackageValidationResult::PCKG_POLICY, "package-not-sorted");
}