| 1137 | } |
| 1138 | |
| 1139 | bool 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 | |
| 1162 | bool MemPoolAccept::ConsensusScriptChecks(const ATMPArgs& args, Workspace& ws) |
| 1163 | { |
nothing calls this directly
no test coverage detected