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.
This commit is contained in:
parent
a589f536b5
commit
ebebedce20
1 changed files with 1 additions and 1 deletions
|
@ -102,7 +102,7 @@ BOOST_FIXTURE_TEST_CASE(tx_mempool_block_doublespend, TestChain100Setup)
|
||||||
// should fail.
|
// should fail.
|
||||||
// Capture this interaction with the upgraded_nop argument: set it when evaluating
|
// Capture this interaction with the upgraded_nop argument: set it when evaluating
|
||||||
// any script flag that is implemented as an upgraded NOP code.
|
// 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);
|
PrecomputedTransactionData txdata(tx);
|
||||||
// If we add many more flags, this loop can get too expensive, but we can
|
// If we add many more flags, this loop can get too expensive, but we can
|
||||||
|
|
Loading…
Reference in a new issue