diff options
author | lucash.dev@gmail.com <lucash.dev@gmail.com> | 2018-06-05 21:38:14 -0700 |
---|---|---|
committer | lucash.dev@gmail.com <lucash.dev@gmail.com> | 2018-06-06 06:50:25 -0700 |
commit | ebebedce2094ac202bdfdf4b13fed562d35d161d (patch) | |
tree | fe0f1c2b387c3c3f75898de55def923fc5025c99 /src/test/txvalidationcache_tests.cpp | |
parent | a589f536b5e15daf3ac6ffcc137a146514c81967 (diff) |
speed up of tx_validationcache_tests by reusing of CTransaction.
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.
Diffstat (limited to 'src/test/txvalidationcache_tests.cpp')
-rw-r--r-- | src/test/txvalidationcache_tests.cpp | 2 |
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 |