mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-02-02 09:54:29 +00:00
Merge pull request #2114 from sipa/strictstrict
Make IsCanonicalScript() check the hash type more thoroughly
This commit is contained in:
commit
c429f2b062
@ -278,7 +278,8 @@ bool IsCanonicalSignature(const valtype &vchSig) {
|
|||||||
return error("Non-canonical signature: too short");
|
return error("Non-canonical signature: too short");
|
||||||
if (vchSig.size() > 73)
|
if (vchSig.size() > 73)
|
||||||
return error("Non-canonical signature: too long");
|
return error("Non-canonical signature: too long");
|
||||||
if (vchSig[vchSig.size() - 1] & 0x7C)
|
unsigned char nHashType = vchSig[vchSig.size() - 1] & (~(SIGHASH_ANYONECANPAY));
|
||||||
|
if (nHashType < SIGHASH_ALL || nHashType > SIGHASH_SINGLE)
|
||||||
return error("Non-canonical signature: unknown hashtype byte");
|
return error("Non-canonical signature: unknown hashtype byte");
|
||||||
if (vchSig[0] != 0x30)
|
if (vchSig[0] != 0x30)
|
||||||
return error("Non-canonical signature: wrong type");
|
return error("Non-canonical signature: wrong type");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user