Bitcoin Core 28.99.0
P2P Digital Currency
Classes | Functions
txvalidationcache_tests.cpp File Reference
#include <consensus/validation.h>
#include <key.h>
#include <random.h>
#include <script/sigcache.h>
#include <script/sign.h>
#include <script/signingprovider.h>
#include <test/util/setup_common.h>
#include <txmempool.h>
#include <util/chaintype.h>
#include <validation.h>
#include <boost/test/unit_test.hpp>
Include dependency graph for txvalidationcache_tests.cpp:

Go to the source code of this file.

Classes

struct  Dersig100Setup
 

Functions

bool CheckInputScripts (const CTransaction &tx, TxValidationState &state, const CCoinsViewCache &inputs, unsigned int flags, bool cacheSigStore, bool cacheFullScriptStore, PrecomputedTransactionData &txdata, ValidationCache &validation_cache, std::vector< CScriptCheck > *pvChecks) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
 Check whether all of this transaction's input scripts succeed. More...
 
 BOOST_FIXTURE_TEST_CASE (tx_mempool_block_doublespend, Dersig100Setup)
 
static void ValidateCheckInputsForAllFlags (const CTransaction &tx, uint32_t failing_flags, bool add_to_cache, CCoinsViewCache &active_coins_tip, ValidationCache &validation_cache) EXCLUSIVE_LOCKS_REQUIRED(
 
 BOOST_FIXTURE_TEST_CASE (checkinputs_test, Dersig100Setup)
 

Function Documentation

◆ BOOST_FIXTURE_TEST_CASE() [1/2]

BOOST_FIXTURE_TEST_CASE ( checkinputs_test  ,
Dersig100Setup   
)

Definition at line 167 of file txvalidationcache_tests.cpp.

Here is the call graph for this function:

◆ BOOST_FIXTURE_TEST_CASE() [2/2]

BOOST_FIXTURE_TEST_CASE ( tx_mempool_block_doublespend  ,
Dersig100Setup   
)

Definition at line 31 of file txvalidationcache_tests.cpp.

Here is the call graph for this function:

◆ CheckInputScripts()

bool CheckInputScripts ( const CTransaction tx,
TxValidationState state,
const CCoinsViewCache inputs,
unsigned int  flags,
bool  cacheSigStore,
bool  cacheFullScriptStore,
PrecomputedTransactionData txdata,
ValidationCache validation_cache,
std::vector< CScriptCheck > *  pvChecks 
)

Check whether all of this transaction's input scripts succeed.

This involves ECDSA signature checks so can be computationally intensive. This function should only be called after the cheap sanity checks in CheckTxInputs passed.

If pvChecks is not nullptr, script checks are pushed onto it instead of being performed inline. Any script checks which are not necessary (eg due to script execution cache hits) are, obviously, not pushed onto pvChecks/run.

Setting cacheSigStore/cacheFullScriptStore to false will remove elements from the corresponding cache which are matched. This is useful for checking blocks where we will likely never need the cache entry again.

Note that we may set state.reason to NOT_STANDARD for extra soft-fork flags in flags, block-checking callers should probably reset it to CONSENSUS in such cases.

Non-static (and redeclared) in src/test/txvalidationcache_tests.cpp

Definition at line 2161 of file validation.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ValidateCheckInputsForAllFlags()

static void ValidateCheckInputsForAllFlags ( const CTransaction tx,
uint32_t  failing_flags,
bool  add_to_cache,
CCoinsViewCache active_coins_tip,
ValidationCache validation_cache 
)
static

Definition at line 123 of file txvalidationcache_tests.cpp.

Here is the call graph for this function:
Here is the caller graph for this function: