Merge #8927: Add script tests for FindAndDelete in pre-segwit and segwit scripts
acf853d
Add script tests for FindAndDelete in pre-segwit and segwit scripts (Johnson Lau)
This commit is contained in:
commit
475d68252e
3 changed files with 51 additions and 2 deletions
src/script
|
@ -890,7 +890,7 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, un
|
|||
// Subset of script starting at the most recent codeseparator
|
||||
CScript scriptCode(pbegincodehash, pend);
|
||||
|
||||
// Drop the signature, since there's no way for a signature to sign itself
|
||||
// Drop the signature in pre-segwit scripts but not segwit scripts
|
||||
if (sigversion == SIGVERSION_BASE) {
|
||||
scriptCode.FindAndDelete(CScript(vchSig));
|
||||
}
|
||||
|
@ -951,7 +951,7 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, un
|
|||
// Subset of script starting at the most recent codeseparator
|
||||
CScript scriptCode(pbegincodehash, pend);
|
||||
|
||||
// Drop the signatures, since there's no way for a signature to sign itself
|
||||
// Drop the signature in pre-segwit scripts but not segwit scripts
|
||||
for (int k = 0; k < nSigsCount; k++)
|
||||
{
|
||||
valtype& vchSig = stacktop(-isig-k);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue