Skip to content

Commit ebebedc

Browse files
committed
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.
1 parent a589f53 commit ebebedc

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
@@ -102,7 +102,7 @@ BOOST_FIXTURE_TEST_CASE(tx_mempool_block_doublespend, TestChain100Setup)
102102
// should fail.
103103
// Capture this interaction with the upgraded_nop argument: set it when evaluating
104104
// any script flag that is implemented as an upgraded NOP code.
105-
static void ValidateCheckInputsForAllFlags(CMutableTransaction &tx, uint32_t failing_flags, bool add_to_cache)
105+
static void ValidateCheckInputsForAllFlags(const CTransaction &tx, uint32_t failing_flags, bool add_to_cache)
106106
{
107107
PrecomputedTransactionData txdata(tx);
108108
// If we add many more flags, this loop can get too expensive, but we can

0 commit comments

Comments
 (0)