Skip to content

Commit 8c8b51e

Browse files
MarcoFalkeUdjinM6
MarcoFalke
authored andcommitted
Merge bitcoin#13404: [tests] speed up of tx_validationcache_tests by reusing of CTransaction.
ebebedc 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 bitcoin#13050. Also, see bitcoin#10026. Tree-SHA512: 61fb81972a08299085a7d3d0060485b265aefc7a4f82ab548e5f94371c8643cfb97bf0ef34f4e1211bf853d0217fa1c3338e4117f36fda1b37d203f690e86d60
1 parent c93ea07 commit 8c8b51e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/test/txvalidationcache_tests.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ BOOST_FIXTURE_TEST_CASE(tx_mempool_block_doublespend, TestChain100Setup)
114114
// should fail.
115115
// Capture this interaction with the upgraded_nop argument: set it when evaluating
116116
// any script flag that is implemented as an upgraded NOP code.
117-
static void ValidateCheckInputsForAllFlags(CMutableTransaction &tx, uint32_t failing_flags, bool add_to_cache)
117+
static void ValidateCheckInputsForAllFlags(const CTransaction &tx, uint32_t failing_flags, bool add_to_cache)
118118
{
119119
PrecomputedTransactionData txdata(tx);
120120
// If we add many more flags, this loop can get too expensive, but we can

0 commit comments

Comments
 (0)