mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-08-26 14:32:17 +00:00
Test ScriptSigArgsExpected() for error, before accumulating return value
This commit is contained in:
parent
7bd9c3a3cf
commit
c0a0a93d02
11
src/main.cpp
11
src/main.cpp
@ -297,6 +297,8 @@ bool CTransaction::AreInputsStandard(const MapPrevTx& mapInputs) const
|
|||||||
if (!Solver(prevScript, whichType, vSolutions))
|
if (!Solver(prevScript, whichType, vSolutions))
|
||||||
return false;
|
return false;
|
||||||
int nArgsExpected = ScriptSigArgsExpected(whichType, vSolutions);
|
int nArgsExpected = ScriptSigArgsExpected(whichType, vSolutions);
|
||||||
|
if (nArgsExpected < 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
// Transactions with extra stuff in their scriptSigs are
|
// Transactions with extra stuff in their scriptSigs are
|
||||||
// non-standard. Note that this EvalScript() call will
|
// non-standard. Note that this EvalScript() call will
|
||||||
@ -318,10 +320,15 @@ bool CTransaction::AreInputsStandard(const MapPrevTx& mapInputs) const
|
|||||||
return false;
|
return false;
|
||||||
if (whichType2 == TX_SCRIPTHASH)
|
if (whichType2 == TX_SCRIPTHASH)
|
||||||
return false;
|
return false;
|
||||||
nArgsExpected += ScriptSigArgsExpected(whichType2, vSolutions2);
|
|
||||||
|
int tmpExpected;
|
||||||
|
tmpExpected = ScriptSigArgsExpected(whichType2, vSolutions2);
|
||||||
|
if (tmpExpected < 0)
|
||||||
|
return false;
|
||||||
|
nArgsExpected += tmpExpected;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stack.size() != nArgsExpected)
|
if (stack.size() != (unsigned int)nArgsExpected)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user