mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Add CScript::IsPayToPubkeyHash convienience function
This commit is contained in:
parent
43424cbf71
commit
8c7746c4de
2 changed files with 11 additions and 0 deletions
|
|
@ -234,6 +234,16 @@ bool CScript::IsPegoutScript(const uint256& genesis_hash_check) const
|
|||
return false;
|
||||
}
|
||||
|
||||
bool CScript::IsPayToPubkeyHash() const
|
||||
{
|
||||
// Extra-fast test for pay-to-pubkey-hash CScripts:
|
||||
return (this->size() == 25 &&
|
||||
(*this)[0] == OP_DUP &&
|
||||
(*this)[1] == OP_HASH160 &&
|
||||
(*this)[2] == 0x14 &&
|
||||
(*this)[23] == OP_EQUALVERIFY &&
|
||||
(*this)[24] == OP_CHECKSIG);
|
||||
}
|
||||
// END ELEMENTS
|
||||
//
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue