mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 15:50:07 +01:00
Merge pull request #4555
6dcfda2Don't pass nHashType to EvalScript nor CheckSig (jtimon)2b23a87Don't pass nHashType to VerifyScript (jtimon)ce3649fbRemove CScriptCheck::nHashType (was always 0) (jtimon)358562bRemove unused function main:VerifySignature (jtimon)
This commit is contained in:
13
src/main.cpp
13
src/main.cpp
@@ -697,7 +697,7 @@ bool AreInputsStandard(const CTransaction& tx, const CCoinsViewCache& mapInputs)
|
||||
// IsStandard() will have already returned false
|
||||
// and this method isn't called.
|
||||
vector<vector<unsigned char> > stack;
|
||||
if (!EvalScript(stack, tx.vin[i].scriptSig, tx, i, false, 0))
|
||||
if (!EvalScript(stack, tx.vin[i].scriptSig, tx, i, false))
|
||||
return false;
|
||||
|
||||
if (whichType == TX_SCRIPTHASH)
|
||||
@@ -1367,16 +1367,11 @@ void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCach
|
||||
|
||||
bool CScriptCheck::operator()() const {
|
||||
const CScript &scriptSig = ptxTo->vin[nIn].scriptSig;
|
||||
if (!VerifyScript(scriptSig, scriptPubKey, *ptxTo, nIn, nFlags, nHashType))
|
||||
if (!VerifyScript(scriptSig, scriptPubKey, *ptxTo, nIn, nFlags))
|
||||
return error("CScriptCheck() : %s VerifySignature failed", ptxTo->GetHash().ToString());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool VerifySignature(const CCoins& txFrom, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType)
|
||||
{
|
||||
return CScriptCheck(txFrom, txTo, nIn, flags, nHashType)();
|
||||
}
|
||||
|
||||
bool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsViewCache &inputs, bool fScriptChecks, unsigned int flags, std::vector<CScriptCheck> *pvChecks)
|
||||
{
|
||||
if (!tx.IsCoinBase())
|
||||
@@ -1445,7 +1440,7 @@ bool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsVi
|
||||
assert(coins);
|
||||
|
||||
// Verify signature
|
||||
CScriptCheck check(*coins, tx, i, flags, 0);
|
||||
CScriptCheck check(*coins, tx, i, flags);
|
||||
if (pvChecks) {
|
||||
pvChecks->push_back(CScriptCheck());
|
||||
check.swap(pvChecks->back());
|
||||
@@ -1458,7 +1453,7 @@ bool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsVi
|
||||
// avoid splitting the network between upgraded and
|
||||
// non-upgraded nodes.
|
||||
CScriptCheck check(*coins, tx, i,
|
||||
flags & ~STANDARD_NOT_MANDATORY_VERIFY_FLAGS, 0);
|
||||
flags & ~STANDARD_NOT_MANDATORY_VERIFY_FLAGS);
|
||||
if (check())
|
||||
return state.Invalid(false, REJECT_NONSTANDARD, "non-mandatory-script-verify-flag");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user