Browse Source
Use v3 transactions with caching for validatelargetx benchmark
pull/4/head
Jack Grigg
6 years ago
No known key found for this signature in database
GPG Key ID: 665DBCD284F7DAFF
1 changed files with
6 additions and
1 deletions
-
src/zcbenchmarks.cpp
|
|
@ -242,6 +242,10 @@ double benchmark_large_tx(size_t nInputs) |
|
|
|
auto orig_tx = CTransaction(m_orig_tx); |
|
|
|
|
|
|
|
CMutableTransaction spending_tx; |
|
|
|
spending_tx.fOverwintered = true; |
|
|
|
spending_tx.nVersion = 3; |
|
|
|
spending_tx.nVersionGroupId = OVERWINTER_VERSION_GROUP_ID; |
|
|
|
|
|
|
|
auto input_hash = orig_tx.GetHash(); |
|
|
|
// Add nInputs inputs
|
|
|
|
for (size_t i = 0; i < nInputs; i++) { |
|
|
@ -260,12 +264,13 @@ double benchmark_large_tx(size_t nInputs) |
|
|
|
// Benchmark signature verification costs:
|
|
|
|
struct timeval tv_start; |
|
|
|
timer_start(tv_start); |
|
|
|
PrecomputedTransactionData txdata(final_spending_tx); |
|
|
|
for (size_t i = 0; i < nInputs; i++) { |
|
|
|
ScriptError serror = SCRIPT_ERR_OK; |
|
|
|
assert(VerifyScript(final_spending_tx.vin[i].scriptSig, |
|
|
|
prevPubKey, |
|
|
|
STANDARD_SCRIPT_VERIFY_FLAGS, |
|
|
|
TransactionSignatureChecker(&final_spending_tx, i, 1000000), |
|
|
|
TransactionSignatureChecker(&final_spending_tx, i, 1000000, txdata), |
|
|
|
consensusBranchId, |
|
|
|
&serror)); |
|
|
|
} |
|
|
|