* Closure representing one script verification * Note that this stores references to the spending transaction */
| 336 | * Note that this stores references to the spending transaction |
| 337 | */ |
| 338 | class CScriptCheck |
| 339 | { |
| 340 | private: |
| 341 | CTxOut m_tx_out; |
| 342 | const CTransaction *ptxTo; |
| 343 | unsigned int nIn; |
| 344 | script_verify_flags m_flags; |
| 345 | bool cacheStore; |
| 346 | PrecomputedTransactionData *txdata; |
| 347 | SignatureCache* m_signature_cache; |
| 348 | |
| 349 | public: |
| 350 | CScriptCheck(const CTxOut& outIn, const CTransaction& txToIn, SignatureCache& signature_cache, unsigned int nInIn, script_verify_flags flags, bool cacheIn, PrecomputedTransactionData* txdataIn) : |
| 351 | m_tx_out(outIn), ptxTo(&txToIn), nIn(nInIn), m_flags(flags), cacheStore(cacheIn), txdata(txdataIn), m_signature_cache(&signature_cache) { } |
| 352 | |
| 353 | CScriptCheck(const CScriptCheck&) = delete; |
| 354 | CScriptCheck& operator=(const CScriptCheck&) = delete; |
| 355 | CScriptCheck(CScriptCheck&&) = default; |
| 356 | CScriptCheck& operator=(CScriptCheck&&) = default; |
| 357 | |
| 358 | std::optional<std::pair<ScriptError, std::string>> operator()(); |
| 359 | }; |
| 360 | |
| 361 | // CScriptCheck is used a lot in std::vector, make sure that's efficient |
| 362 | static_assert(std::is_nothrow_move_assignable_v<CScriptCheck>); |
no outgoing calls