From d2716e9e5bcd7029153875b06f4606903d46fd83 Mon Sep 17 00:00:00 2001 From: ismaelsadeeq Date: Thu, 23 Nov 2023 23:22:08 +0100 Subject: [PATCH 1/3] 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. --- src/bench/ccoins_caching.cpp | 3 +- src/policy/policy.cpp | 40 ++++++++++++++++++--------- src/policy/policy.h | 12 ++++---- src/test/fuzz/coins_view.cpp | 2 +- src/test/fuzz/transaction.cpp | 2 +- src/test/script_p2sh_tests.cpp | 8 +++--- src/test/transaction_tests.cpp | 32 +++++++++++++++------ src/validation.cpp | 7 +++-- test/functional/mempool_sigoplimit.py | 3 +- 9 files changed, 71 insertions(+), 38 deletions(-) diff --git a/src/bench/ccoins_caching.cpp b/src/bench/ccoins_caching.cpp index 351861536ca..673616a5a74 100644 --- a/src/bench/ccoins_caching.cpp +++ b/src/bench/ccoins_caching.cpp @@ -49,8 +49,7 @@ static void CCoinsCaching(benchmark::Bench& bench) // Benchmark. const CTransaction tx_1(t1); bench.run([&] { - bool success{AreInputsStandard(tx_1, coins)}; - assert(success); + assert(ValidateInputsStandardness(tx_1, coins).IsValid()); }); } diff --git a/src/policy/policy.cpp b/src/policy/policy.cpp index 3da6cb7489b..2f5f9fce838 100644 --- a/src/policy/policy.cpp +++ b/src/policy/policy.cpp @@ -18,6 +18,7 @@ #include