mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-27 01:11:59 +02:00
consensus, refactor: Avoid CScriptCheck::swap
in CheckInputScripts
This commit is contained in:
parent
f4e42a78c7
commit
15209d97c6
@ -1815,8 +1815,7 @@ bool CheckInputScripts(const CTransaction& tx, TxValidationState& state,
|
|||||||
// Verify signature
|
// Verify signature
|
||||||
CScriptCheck check(txdata.m_spent_outputs[i], tx, i, flags, cacheSigStore, &txdata);
|
CScriptCheck check(txdata.m_spent_outputs[i], tx, i, flags, cacheSigStore, &txdata);
|
||||||
if (pvChecks) {
|
if (pvChecks) {
|
||||||
pvChecks->push_back(CScriptCheck());
|
pvChecks->emplace_back(std::move(check));
|
||||||
check.swap(pvChecks->back());
|
|
||||||
} else if (!check()) {
|
} else if (!check()) {
|
||||||
if (flags & STANDARD_NOT_MANDATORY_VERIFY_FLAGS) {
|
if (flags & STANDARD_NOT_MANDATORY_VERIFY_FLAGS) {
|
||||||
// Check whether the failure was caused by a
|
// Check whether the failure was caused by a
|
||||||
|
@ -322,6 +322,11 @@ public:
|
|||||||
CScriptCheck(const CTxOut& outIn, const CTransaction& txToIn, unsigned int nInIn, unsigned int nFlagsIn, bool cacheIn, PrecomputedTransactionData* txdataIn) :
|
CScriptCheck(const CTxOut& outIn, const CTransaction& txToIn, unsigned int nInIn, unsigned int nFlagsIn, bool cacheIn, PrecomputedTransactionData* txdataIn) :
|
||||||
m_tx_out(outIn), ptxTo(&txToIn), nIn(nInIn), nFlags(nFlagsIn), cacheStore(cacheIn), error(SCRIPT_ERR_UNKNOWN_ERROR), txdata(txdataIn) { }
|
m_tx_out(outIn), ptxTo(&txToIn), nIn(nInIn), nFlags(nFlagsIn), cacheStore(cacheIn), error(SCRIPT_ERR_UNKNOWN_ERROR), txdata(txdataIn) { }
|
||||||
|
|
||||||
|
CScriptCheck(const CScriptCheck&) = delete;
|
||||||
|
CScriptCheck& operator=(const CScriptCheck&) = delete;
|
||||||
|
CScriptCheck(CScriptCheck&&) = default;
|
||||||
|
CScriptCheck& operator=(CScriptCheck&&) = default;
|
||||||
|
|
||||||
bool operator()();
|
bool operator()();
|
||||||
|
|
||||||
void swap(CScriptCheck& check) noexcept
|
void swap(CScriptCheck& check) noexcept
|
||||||
|
Loading…
x
Reference in New Issue
Block a user