aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2018-06-07 10:20:00 -0400
committerMarcoFalke <falke.marco@gmail.com>2018-06-07 10:20:07 -0400
commit3d3d8ae3a0a93621044ab0b889bad082cc91d016 (patch)
tree1cd5ae991754afef4e39c1e99c8cab395c04b408
parentf8bcef38fb9be48f0f5908a6c4c0cbe8c5a729d6 (diff)
parentebebedce2094ac202bdfdf4b13fed562d35d161d (diff)
Merge #13404: [tests] speed up of tx_validationcache_tests by reusing of CTransaction.
ebebedce20 speed up of tx_validationcache_tests by reusing of CTransaction. (lucash.dev@gmail.com) Pull request description: The code was converting CMutableTransaction to CTransaction multiple times, which implies recalculating the hash multiple times. This commit fixes this by reusing a single CTransaction. Run-time results: ``` Before: 6.7s After: 5.5s -------------- Saved: 1.2s ``` This PR was split from #13050. Also, see #10026. Tree-SHA512: 61fb81972a08299085a7d3d0060485b265aefc7a4f82ab548e5f94371c8643cfb97bf0ef34f4e1211bf853d0217fa1c3338e4117f36fda1b37d203f690e86d60
-rw-r--r--src/test/txvalidationcache_tests.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/txvalidationcache_tests.cpp b/src/test/txvalidationcache_tests.cpp
index 2b00064cd0..d32d4b267c 100644
--- a/src/test/txvalidationcache_tests.cpp
+++ b/src/test/txvalidationcache_tests.cpp
@@ -102,7 +102,7 @@ BOOST_FIXTURE_TEST_CASE(tx_mempool_block_doublespend, TestChain100Setup)
// should fail.
// Capture this interaction with the upgraded_nop argument: set it when evaluating
// any script flag that is implemented as an upgraded NOP code.
-static void ValidateCheckInputsForAllFlags(CMutableTransaction &tx, uint32_t failing_flags, bool add_to_cache)
+static void ValidateCheckInputsForAllFlags(const CTransaction &tx, uint32_t failing_flags, bool add_to_cache)
{
PrecomputedTransactionData txdata(tx);
// If we add many more flags, this loop can get too expensive, but we can