policy: update AreInputsStandard to return error string

This commit renames AreInputsStandard to ValidateInputsStandardness.

ValidateInputsStandardness now returns valid TxValidationState if all inputs
(scriptSigs) use only standard transaction forms else returns invalid
TxValidationState which states why an input is not standard.
This commit is contained in:
ismaelsadeeq
2023-11-23 23:22:08 +01:00
committed by ismaelsadeeq
parent 563747971b
commit d2716e9e5b
9 changed files with 71 additions and 38 deletions

View File

@@ -894,8 +894,11 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
return false; // state filled in by CheckTxInputs
}
if (m_pool.m_opts.require_standard && !AreInputsStandard(tx, m_view)) {
return state.Invalid(TxValidationResult::TX_INPUTS_NOT_STANDARD, "bad-txns-nonstandard-inputs");
if (m_pool.m_opts.require_standard) {
state = ValidateInputsStandardness(tx, m_view);
if (state.IsInvalid()) {
return false;
}
}
// Check for non-standard witnesses.