1
0
Fork 0
mirror of https://github.com/bitcoin/bips.git synced 2025-03-13 11:09:16 +01:00

[BIP-119]: Make IsPayToBareDefaultCheckTemplateVerifyHash Pythonic

This commit is contained in:
Jeremy Rubin 2022-04-28 09:47:43 -07:00
parent cad2b3ee77
commit 78fc9f2ceb

View file

@ -239,13 +239,10 @@ optimization.
A PayToBareDefaultCheckTemplateVerifyHash output matches the following template:
bool CScript::IsPayToBareDefaultCheckTemplateVerifyHash() const
{
// Extra-fast test for pay-to-basic-standard-template CScripts:
return (this->size() == 34 &&
(*this)[0] == 0x20 &&
(*this)[33] == OP_CHECKTEMPLATEVERIFY);
}
# Extra-fast test for pay-to-basic-standard-template CScripts:
def is_pay_to_bare_default_check_template_verify_hash(self):
return len(self) == 34 and self[0] == 0x20 and self[-1] == OP_CHECKTEMPLATEVERIFY
==Deployment==