aboutsummaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorJohnson Lau <jl2012@xbt.hk>2016-10-15 23:45:07 +0800
committerLuke Dashjr <luke-jr+git@utopios.org>2016-12-02 07:56:12 +0000
commit387ec9d9635580fbbedc222126c5b1a68002d543 (patch)
tree82e4fcbe8c32fc71d80793d2d800bd724649b941 /src/script
parent87fbcede5ceb49fc24c3102c0f3cf81a68617ac6 (diff)
downloadbitcoin-387ec9d9635580fbbedc222126c5b1a68002d543.tar.xz
Add script tests for FindAndDelete in pre-segwit and segwit scripts
Github-Pull: #8927 Rebased-From: acf853df910339412bafb1743f42af1774f5b910
Diffstat (limited to 'src/script')
-rw-r--r--src/script/interpreter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp
index 836cf9ee35..0e17ddc130 100644
--- a/src/script/interpreter.cpp
+++ b/src/script/interpreter.cpp
@@ -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);