MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / PolicyScriptChecks

Method PolicyScriptChecks

src/validation.cpp:1139–1160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1137}
1138
1139bool MemPoolAccept::PolicyScriptChecks(const ATMPArgs& args, Workspace& ws)
1140{
1141 AssertLockHeld(cs_main);
1142 AssertLockHeld(m_pool.cs);
1143 const CTransaction& tx = *ws.m_ptx;
1144 TxValidationState& state = ws.m_state;
1145
1146 constexpr script_verify_flags scriptVerifyFlags = STANDARD_SCRIPT_VERIFY_FLAGS;
1147
1148 // Check input scripts and signatures.
1149 // This is done last to help prevent CPU exhaustion denial-of-service attacks.
1150 if (!CheckInputScripts(tx, state, m_view, scriptVerifyFlags, true, false, ws.m_precomputed_txdata, GetValidationCache())) {
1151 // Detect a failure due to a missing witness so that p2p code can handle rejection caching appropriately.
1152 if (!tx.HasWitness() && SpendsNonAnchorWitnessProg(tx, m_view)) {
1153 state.Invalid(TxValidationResult::TX_WITNESS_STRIPPED,
1154 state.GetRejectReason(), state.GetDebugMessage());
1155 }
1156 return false; // state filled in by CheckInputScripts
1157 }
1158
1159 return true;
1160}
1161
1162bool MemPoolAccept::ConsensusScriptChecks(const ATMPArgs& args, Workspace& ws)
1163{

Callers

nothing calls this directly

Calls 6

CheckInputScriptsFunction · 0.85
InvalidMethod · 0.80
GetRejectReasonMethod · 0.80
GetDebugMessageMethod · 0.80
HasWitnessMethod · 0.45

Tested by

no test coverage detected