Changeset View
Changeset View
Standalone View
Standalone View
src/test/txvalidationcache_tests.cpp
Show First 20 Lines • Show All 96 Lines • ▼ Show 20 Lines | BOOST_FIXTURE_TEST_CASE(tx_mempool_block_doublespend, TestChain100Setup) { | ||||
} | } | ||||
// spends[1] should have been removed from the mempool when the block with | // spends[1] should have been removed from the mempool when the block with | ||||
// spends[0] is accepted: | // spends[0] is accepted: | ||||
BOOST_CHECK_EQUAL(m_node.mempool->size(), 0U); | BOOST_CHECK_EQUAL(m_node.mempool->size(), 0U); | ||||
} | } | ||||
static inline bool | static inline bool | ||||
CheckInputs(const CTransaction &tx, TxValidationState &state, | CheckInputs(const CTransaction &tx, TxValidationState &state, | ||||
const CCoinsViewCache &view, bool fScriptChecks, | const CCoinsViewCache &view, const uint32_t flags, | ||||
const uint32_t flags, bool sigCacheStore, bool scriptCacheStore, | bool sigCacheStore, bool scriptCacheStore, | ||||
const PrecomputedTransactionData &txdata, int &nSigChecksOut, | const PrecomputedTransactionData &txdata, int &nSigChecksOut, | ||||
std::vector<CScriptCheck> *pvChecks, | std::vector<CScriptCheck> *pvChecks, | ||||
CheckInputsLimiter *pBlockLimitSigChecks = nullptr) | CheckInputsLimiter *pBlockLimitSigChecks = nullptr) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main) { | EXCLUSIVE_LOCKS_REQUIRED(cs_main) { | ||||
// nSigChecksTxLimiter need to outlive this function call, because test | // nSigChecksTxLimiter need to outlive this function call, because test | ||||
// cases are using pvChecks, so the verification is done asynchronously. | // cases are using pvChecks, so the verification is done asynchronously. | ||||
static TxSigCheckLimiter nSigChecksTxLimiter; | static TxSigCheckLimiter nSigChecksTxLimiter; | ||||
nSigChecksTxLimiter = TxSigCheckLimiter(); | nSigChecksTxLimiter = TxSigCheckLimiter(); | ||||
return CheckInputs(tx, state, view, fScriptChecks, flags, sigCacheStore, | return CheckInputs(tx, state, view, flags, sigCacheStore, scriptCacheStore, | ||||
scriptCacheStore, txdata, nSigChecksOut, | txdata, nSigChecksOut, nSigChecksTxLimiter, | ||||
nSigChecksTxLimiter, pBlockLimitSigChecks, pvChecks); | pBlockLimitSigChecks, pvChecks); | ||||
} | } | ||||
// Run CheckInputs (using pcoinsTip) on the given transaction, for all script | // Run CheckInputs (using pcoinsTip) on the given transaction, for all script | ||||
// flags. Test that CheckInputs passes for all flags that don't overlap with the | // flags. Test that CheckInputs passes for all flags that don't overlap with the | ||||
// failing_flags argument, but otherwise fails. | // failing_flags argument, but otherwise fails. | ||||
// CHECKLOCKTIMEVERIFY and CHECKSEQUENCEVERIFY (and future NOP codes that may | // CHECKLOCKTIMEVERIFY and CHECKSEQUENCEVERIFY (and future NOP codes that may | ||||
// get reassigned) have an interaction with DISCOURAGE_UPGRADABLE_NOPS: if the | // get reassigned) have an interaction with DISCOURAGE_UPGRADABLE_NOPS: if the | ||||
// script flags used contain DISCOURAGE_UPGRADABLE_NOPS but don't contain | // script flags used contain DISCOURAGE_UPGRADABLE_NOPS but don't contain | ||||
Show All 17 Lines | for (int i = 0; i < 4096; i++) { | ||||
// Filter out incompatible flag choices | // Filter out incompatible flag choices | ||||
if ((test_flags & SCRIPT_VERIFY_CLEANSTACK)) { | if ((test_flags & SCRIPT_VERIFY_CLEANSTACK)) { | ||||
// CLEANSTACK requires P2SH, see VerifyScript() in | // CLEANSTACK requires P2SH, see VerifyScript() in | ||||
// script/interpreter.cpp | // script/interpreter.cpp | ||||
test_flags |= SCRIPT_VERIFY_P2SH; | test_flags |= SCRIPT_VERIFY_P2SH; | ||||
} | } | ||||
int nSigChecksDirect = 0xf00d; | int nSigChecksDirect = 0xf00d; | ||||
bool ret = CheckInputs(tx, state, pcoinsTip.get(), true, test_flags, | bool ret = CheckInputs(tx, state, pcoinsTip.get(), test_flags, true, | ||||
true, add_to_cache, txdata, nSigChecksDirect); | add_to_cache, txdata, nSigChecksDirect); | ||||
// CheckInputs should succeed iff test_flags doesn't intersect with | // CheckInputs should succeed iff test_flags doesn't intersect with | ||||
// failing_flags | // failing_flags | ||||
bool expected_return_value = !(test_flags & failing_flags); | bool expected_return_value = !(test_flags & failing_flags); | ||||
BOOST_CHECK_EQUAL(ret, expected_return_value); | BOOST_CHECK_EQUAL(ret, expected_return_value); | ||||
if (ret) { | if (ret) { | ||||
BOOST_CHECK(nSigChecksDirect == expected_sigchecks); | BOOST_CHECK(nSigChecksDirect == expected_sigchecks); | ||||
} | } | ||||
// Test the caching | // Test the caching | ||||
if (ret && add_to_cache) { | if (ret && add_to_cache) { | ||||
// Check that we get a cache hit if the tx was valid | // Check that we get a cache hit if the tx was valid | ||||
std::vector<CScriptCheck> scriptchecks; | std::vector<CScriptCheck> scriptchecks; | ||||
int nSigChecksCached = 0xbeef; | int nSigChecksCached = 0xbeef; | ||||
BOOST_CHECK(CheckInputs(tx, state, pcoinsTip.get(), true, | BOOST_CHECK(CheckInputs(tx, state, pcoinsTip.get(), test_flags, | ||||
test_flags, true, add_to_cache, txdata, | true, add_to_cache, txdata, | ||||
nSigChecksCached, &scriptchecks)); | nSigChecksCached, &scriptchecks)); | ||||
BOOST_CHECK(nSigChecksCached == nSigChecksDirect); | BOOST_CHECK(nSigChecksCached == nSigChecksDirect); | ||||
BOOST_CHECK(scriptchecks.empty()); | BOOST_CHECK(scriptchecks.empty()); | ||||
} else { | } else { | ||||
// Check that we get script executions to check, if the transaction | // Check that we get script executions to check, if the transaction | ||||
// was invalid, or we didn't add to cache. | // was invalid, or we didn't add to cache. | ||||
std::vector<CScriptCheck> scriptchecks; | std::vector<CScriptCheck> scriptchecks; | ||||
int nSigChecksUncached = 0xbabe; | int nSigChecksUncached = 0xbabe; | ||||
BOOST_CHECK(CheckInputs(tx, state, pcoinsTip.get(), true, | BOOST_CHECK(CheckInputs(tx, state, pcoinsTip.get(), test_flags, | ||||
test_flags, true, add_to_cache, txdata, | true, add_to_cache, txdata, | ||||
nSigChecksUncached, &scriptchecks)); | nSigChecksUncached, &scriptchecks)); | ||||
BOOST_CHECK(!ret || nSigChecksUncached == 0); | BOOST_CHECK(!ret || nSigChecksUncached == 0); | ||||
BOOST_CHECK_EQUAL(scriptchecks.size(), tx.vin.size()); | BOOST_CHECK_EQUAL(scriptchecks.size(), tx.vin.size()); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
BOOST_FIXTURE_TEST_CASE(checkinputs_test, TestChain100Setup) { | BOOST_FIXTURE_TEST_CASE(checkinputs_test, TestChain100Setup) { | ||||
▲ Show 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | // spend_tx is invalid according to DISCOURAGE_UPGRADABLE_NOPS | ||||
const CTransaction tx(spend_tx); | const CTransaction tx(spend_tx); | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
TxValidationState state; | TxValidationState state; | ||||
PrecomputedTransactionData ptd_spend_tx(tx); | PrecomputedTransactionData ptd_spend_tx(tx); | ||||
int nSigChecksDummy; | int nSigChecksDummy; | ||||
BOOST_CHECK(!CheckInputs(tx, state, pcoinsTip.get(), true, | BOOST_CHECK(!CheckInputs(tx, state, pcoinsTip.get(), | ||||
STANDARD_SCRIPT_VERIFY_FLAGS, true, true, | STANDARD_SCRIPT_VERIFY_FLAGS, true, true, | ||||
ptd_spend_tx, nSigChecksDummy, nullptr)); | ptd_spend_tx, nSigChecksDummy, nullptr)); | ||||
// If we call again asking for scriptchecks (as happens in | // If we call again asking for scriptchecks (as happens in | ||||
// ConnectBlock), we should add a script check object for this -- we're | // ConnectBlock), we should add a script check object for this -- we're | ||||
// not caching invalidity (if that changes, delete this test case). | // not caching invalidity (if that changes, delete this test case). | ||||
std::vector<CScriptCheck> scriptchecks; | std::vector<CScriptCheck> scriptchecks; | ||||
BOOST_CHECK(CheckInputs(tx, state, pcoinsTip.get(), true, | BOOST_CHECK(CheckInputs(tx, state, pcoinsTip.get(), | ||||
STANDARD_SCRIPT_VERIFY_FLAGS, true, true, | STANDARD_SCRIPT_VERIFY_FLAGS, true, true, | ||||
ptd_spend_tx, nSigChecksDummy, &scriptchecks)); | ptd_spend_tx, nSigChecksDummy, &scriptchecks)); | ||||
BOOST_CHECK_EQUAL(scriptchecks.size(), 1U); | BOOST_CHECK_EQUAL(scriptchecks.size(), 1U); | ||||
// Test that CheckInputs returns true iff cleanstack-enforcing flags are | // Test that CheckInputs returns true iff cleanstack-enforcing flags are | ||||
// not present. Don't add these checks to the cache, so that we can test | // not present. Don't add these checks to the cache, so that we can test | ||||
// later that block validation works fine in the absence of cached | // later that block validation works fine in the absence of cached | ||||
// successes. | // successes. | ||||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | // Test CHECKLOCKTIMEVERIFY | ||||
// Make it valid, and check again | // Make it valid, and check again | ||||
invalid_with_cltv_tx.vin[0].scriptSig = CScript() << vchSig << 100; | invalid_with_cltv_tx.vin[0].scriptSig = CScript() << vchSig << 100; | ||||
TxValidationState state; | TxValidationState state; | ||||
CTransaction transaction(invalid_with_cltv_tx); | CTransaction transaction(invalid_with_cltv_tx); | ||||
PrecomputedTransactionData txdata(transaction); | PrecomputedTransactionData txdata(transaction); | ||||
int nSigChecksRet; | int nSigChecksRet; | ||||
BOOST_CHECK(CheckInputs(transaction, state, pcoinsTip.get(), true, | BOOST_CHECK(CheckInputs(transaction, state, pcoinsTip.get(), | ||||
STANDARD_SCRIPT_VERIFY_FLAGS, true, true, | STANDARD_SCRIPT_VERIFY_FLAGS, true, true, | ||||
txdata, nSigChecksRet, nullptr)); | txdata, nSigChecksRet, nullptr)); | ||||
BOOST_CHECK(nSigChecksRet == 1); | BOOST_CHECK(nSigChecksRet == 1); | ||||
} | } | ||||
// TEST CHECKSEQUENCEVERIFY | // TEST CHECKSEQUENCEVERIFY | ||||
{ | { | ||||
CMutableTransaction invalid_with_csv_tx; | CMutableTransaction invalid_with_csv_tx; | ||||
Show All 22 Lines | // TEST CHECKSEQUENCEVERIFY | ||||
// Make it valid, and check again | // Make it valid, and check again | ||||
invalid_with_csv_tx.vin[0].scriptSig = CScript() << vchSig << 100; | invalid_with_csv_tx.vin[0].scriptSig = CScript() << vchSig << 100; | ||||
TxValidationState state; | TxValidationState state; | ||||
CTransaction transaction(invalid_with_csv_tx); | CTransaction transaction(invalid_with_csv_tx); | ||||
PrecomputedTransactionData txdata(transaction); | PrecomputedTransactionData txdata(transaction); | ||||
int nSigChecksRet; | int nSigChecksRet; | ||||
BOOST_CHECK(CheckInputs(transaction, state, pcoinsTip.get(), true, | BOOST_CHECK(CheckInputs(transaction, state, pcoinsTip.get(), | ||||
STANDARD_SCRIPT_VERIFY_FLAGS, true, true, | STANDARD_SCRIPT_VERIFY_FLAGS, true, true, | ||||
txdata, nSigChecksRet, nullptr)); | txdata, nSigChecksRet, nullptr)); | ||||
BOOST_CHECK(nSigChecksRet == 1); | BOOST_CHECK(nSigChecksRet == 1); | ||||
} | } | ||||
// TODO: add tests for remaining script flags | // TODO: add tests for remaining script flags | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | // TODO: add tests for remaining script flags | ||||
int nSigChecksDummy; | int nSigChecksDummy; | ||||
/** | /** | ||||
* Parallel validation initially works (no cached value), but | * Parallel validation initially works (no cached value), but | ||||
* evaluation of the script checks produces a failure. | * evaluation of the script checks produces a failure. | ||||
*/ | */ | ||||
std::vector<CScriptCheck> scriptchecks1; | std::vector<CScriptCheck> scriptchecks1; | ||||
CheckInputsLimiter sigchecklimiter1(1); | CheckInputsLimiter sigchecklimiter1(1); | ||||
BOOST_CHECK(CheckInputs(transaction, state, pcoinsTip.get(), true, | BOOST_CHECK(CheckInputs(transaction, state, pcoinsTip.get(), flags, | ||||
flags, true, true, txdata, nSigChecksDummy, | true, true, txdata, nSigChecksDummy, | ||||
&scriptchecks1, &sigchecklimiter1)); | &scriptchecks1, &sigchecklimiter1)); | ||||
// the first check passes but it did consume the limit. | // the first check passes but it did consume the limit. | ||||
BOOST_CHECK(scriptchecks1[1]()); | BOOST_CHECK(scriptchecks1[1]()); | ||||
BOOST_CHECK(sigchecklimiter1.check()); | BOOST_CHECK(sigchecklimiter1.check()); | ||||
// the second check (the first input) fails due to the limiter. | // the second check (the first input) fails due to the limiter. | ||||
BOOST_CHECK(!scriptchecks1[0]()); | BOOST_CHECK(!scriptchecks1[0]()); | ||||
BOOST_CHECK_EQUAL(scriptchecks1[0].GetScriptError(), | BOOST_CHECK_EQUAL(scriptchecks1[0].GetScriptError(), | ||||
ScriptError::SIGCHECKS_LIMIT_EXCEEDED); | ScriptError::SIGCHECKS_LIMIT_EXCEEDED); | ||||
BOOST_CHECK(!sigchecklimiter1.check()); | BOOST_CHECK(!sigchecklimiter1.check()); | ||||
// Serial validation fails with the limiter. | // Serial validation fails with the limiter. | ||||
CheckInputsLimiter sigchecklimiter2(1); | CheckInputsLimiter sigchecklimiter2(1); | ||||
TxValidationState state2; | TxValidationState state2; | ||||
BOOST_CHECK(!CheckInputs(transaction, state2, pcoinsTip.get(), true, | BOOST_CHECK(!CheckInputs(transaction, state2, pcoinsTip.get(), | ||||
flags, true, true, txdata, nSigChecksDummy, | flags, true, true, txdata, nSigChecksDummy, | ||||
nullptr, &sigchecklimiter2)); | nullptr, &sigchecklimiter2)); | ||||
BOOST_CHECK(!sigchecklimiter2.check()); | BOOST_CHECK(!sigchecklimiter2.check()); | ||||
BOOST_CHECK_EQUAL(state2.GetRejectReason(), | BOOST_CHECK_EQUAL(state2.GetRejectReason(), | ||||
"non-mandatory-script-verify-flag (Validation " | "non-mandatory-script-verify-flag (Validation " | ||||
"resources exceeded (SigChecks))"); | "resources exceeded (SigChecks))"); | ||||
/** | /** | ||||
* A slightly more permissive limiter (just enough) passes, and | * A slightly more permissive limiter (just enough) passes, and | ||||
* allows caching the result. | * allows caching the result. | ||||
*/ | */ | ||||
std::vector<CScriptCheck> scriptchecks3; | std::vector<CScriptCheck> scriptchecks3; | ||||
CheckInputsLimiter sigchecklimiter3(2); | CheckInputsLimiter sigchecklimiter3(2); | ||||
// first in parallel | // first in parallel | ||||
BOOST_CHECK(CheckInputs(transaction, state, pcoinsTip.get(), true, | BOOST_CHECK(CheckInputs(transaction, state, pcoinsTip.get(), flags, | ||||
flags, true, true, txdata, nSigChecksDummy, | true, true, txdata, nSigChecksDummy, | ||||
&scriptchecks3, &sigchecklimiter3)); | &scriptchecks3, &sigchecklimiter3)); | ||||
BOOST_CHECK(scriptchecks3[1]()); | BOOST_CHECK(scriptchecks3[1]()); | ||||
BOOST_CHECK(scriptchecks3[0]()); | BOOST_CHECK(scriptchecks3[0]()); | ||||
BOOST_CHECK(sigchecklimiter3.check()); | BOOST_CHECK(sigchecklimiter3.check()); | ||||
// then in serial, caching the result. | // then in serial, caching the result. | ||||
CheckInputsLimiter sigchecklimiter4(2); | CheckInputsLimiter sigchecklimiter4(2); | ||||
BOOST_CHECK(CheckInputs(transaction, state, pcoinsTip.get(), true, | BOOST_CHECK(CheckInputs(transaction, state, pcoinsTip.get(), flags, | ||||
flags, true, true, txdata, nSigChecksDummy, | true, true, txdata, nSigChecksDummy, | ||||
nullptr, &sigchecklimiter4)); | nullptr, &sigchecklimiter4)); | ||||
BOOST_CHECK(sigchecklimiter4.check()); | BOOST_CHECK(sigchecklimiter4.check()); | ||||
// now in parallel again, grabbing the cached result. | // now in parallel again, grabbing the cached result. | ||||
std::vector<CScriptCheck> scriptchecks5; | std::vector<CScriptCheck> scriptchecks5; | ||||
CheckInputsLimiter sigchecklimiter5(2); | CheckInputsLimiter sigchecklimiter5(2); | ||||
BOOST_CHECK(CheckInputs(transaction, state, pcoinsTip.get(), true, | BOOST_CHECK(CheckInputs(transaction, state, pcoinsTip.get(), flags, | ||||
flags, true, true, txdata, nSigChecksDummy, | true, true, txdata, nSigChecksDummy, | ||||
&scriptchecks5, &sigchecklimiter5)); | &scriptchecks5, &sigchecklimiter5)); | ||||
BOOST_CHECK(scriptchecks5.empty()); | BOOST_CHECK(scriptchecks5.empty()); | ||||
BOOST_CHECK(sigchecklimiter5.check()); | BOOST_CHECK(sigchecklimiter5.check()); | ||||
/** | /** | ||||
* Going back to the lower limit, we now fail immediately due to the | * Going back to the lower limit, we now fail immediately due to the | ||||
* caching. | * caching. | ||||
*/ | */ | ||||
CheckInputsLimiter sigchecklimiter6(1); | CheckInputsLimiter sigchecklimiter6(1); | ||||
TxValidationState state6; | TxValidationState state6; | ||||
BOOST_CHECK(!CheckInputs(transaction, state6, pcoinsTip.get(), true, | BOOST_CHECK(!CheckInputs(transaction, state6, pcoinsTip.get(), | ||||
flags, true, true, txdata, nSigChecksDummy, | flags, true, true, txdata, nSigChecksDummy, | ||||
nullptr, &sigchecklimiter6)); | nullptr, &sigchecklimiter6)); | ||||
BOOST_CHECK_EQUAL(state6.GetRejectReason(), "too-many-sigchecks"); | BOOST_CHECK_EQUAL(state6.GetRejectReason(), "too-many-sigchecks"); | ||||
BOOST_CHECK_EQUAL(state6.GetResult(), | BOOST_CHECK_EQUAL(state6.GetResult(), | ||||
TxValidationResult::TX_CONSENSUS); | TxValidationResult::TX_CONSENSUS); | ||||
BOOST_CHECK(!sigchecklimiter6.check()); | BOOST_CHECK(!sigchecklimiter6.check()); | ||||
// even in parallel validation, immediate fail from the cache. | // even in parallel validation, immediate fail from the cache. | ||||
std::vector<CScriptCheck> scriptchecks7; | std::vector<CScriptCheck> scriptchecks7; | ||||
CheckInputsLimiter sigchecklimiter7(1); | CheckInputsLimiter sigchecklimiter7(1); | ||||
TxValidationState state7; | TxValidationState state7; | ||||
BOOST_CHECK(!CheckInputs(transaction, state7, pcoinsTip.get(), true, | BOOST_CHECK(!CheckInputs(transaction, state7, pcoinsTip.get(), | ||||
flags, true, true, txdata, nSigChecksDummy, | flags, true, true, txdata, nSigChecksDummy, | ||||
&scriptchecks7, &sigchecklimiter7)); | &scriptchecks7, &sigchecklimiter7)); | ||||
BOOST_CHECK_EQUAL(state7.GetRejectReason(), "too-many-sigchecks"); | BOOST_CHECK_EQUAL(state7.GetRejectReason(), "too-many-sigchecks"); | ||||
BOOST_CHECK_EQUAL(state6.GetResult(), | BOOST_CHECK_EQUAL(state6.GetResult(), | ||||
TxValidationResult::TX_CONSENSUS); | TxValidationResult::TX_CONSENSUS); | ||||
BOOST_CHECK(!sigchecklimiter7.check()); | BOOST_CHECK(!sigchecklimiter7.check()); | ||||
BOOST_CHECK(scriptchecks7.empty()); | BOOST_CHECK(scriptchecks7.empty()); | ||||
} | } | ||||
// Check that if the second input is invalid, but the first input is | // Check that if the second input is invalid, but the first input is | ||||
// valid, the transaction is not cached. | // valid, the transaction is not cached. | ||||
// Invalidate vin[1] | // Invalidate vin[1] | ||||
tx.vin[1].scriptSig = CScript(); | tx.vin[1].scriptSig = CScript(); | ||||
TxValidationState state; | TxValidationState state; | ||||
CTransaction transaction(tx); | CTransaction transaction(tx); | ||||
PrecomputedTransactionData txdata(transaction); | PrecomputedTransactionData txdata(transaction); | ||||
// This transaction is now invalid because the second signature is | // This transaction is now invalid because the second signature is | ||||
// missing. | // missing. | ||||
int nSigChecksDummy; | int nSigChecksDummy; | ||||
BOOST_CHECK(!CheckInputs(transaction, state, pcoinsTip.get(), true, | BOOST_CHECK(!CheckInputs(transaction, state, pcoinsTip.get(), | ||||
STANDARD_SCRIPT_VERIFY_FLAGS, true, true, | STANDARD_SCRIPT_VERIFY_FLAGS, true, true, | ||||
txdata, nSigChecksDummy, nullptr)); | txdata, nSigChecksDummy, nullptr)); | ||||
// Make sure this transaction was not cached (ie becausethe first input | // Make sure this transaction was not cached (ie becausethe first input | ||||
// was valid) | // was valid) | ||||
std::vector<CScriptCheck> scriptchecks; | std::vector<CScriptCheck> scriptchecks; | ||||
BOOST_CHECK( | BOOST_CHECK( | ||||
CheckInputs(transaction, state, pcoinsTip.get(), true, | CheckInputs(transaction, state, pcoinsTip.get(), | ||||
STANDARD_SCRIPT_VERIFY_FLAGS | SCRIPT_ENFORCE_SIGCHECKS, | STANDARD_SCRIPT_VERIFY_FLAGS | SCRIPT_ENFORCE_SIGCHECKS, | ||||
true, true, txdata, nSigChecksDummy, &scriptchecks)); | true, true, txdata, nSigChecksDummy, &scriptchecks)); | ||||
// Should get 2 script checks back -- caching is on a whole-transaction | // Should get 2 script checks back -- caching is on a whole-transaction | ||||
// basis. | // basis. | ||||
BOOST_CHECK_EQUAL(scriptchecks.size(), 2U); | BOOST_CHECK_EQUAL(scriptchecks.size(), 2U); | ||||
// Execute the first check, and check its result | // Execute the first check, and check its result | ||||
BOOST_CHECK(scriptchecks[0]()); | BOOST_CHECK(scriptchecks[0]()); | ||||
▲ Show 20 Lines • Show All 94 Lines • Show Last 20 Lines |