mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-10 15:47:17 +02:00
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:
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user