mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Add IsPayToWitnessPubkeyHash convenience function
This commit is contained in:
parent
1241343bd5
commit
71acfb359b
2 changed files with 8 additions and 0 deletions
|
|
@ -244,6 +244,13 @@ bool CScript::IsPayToPubkeyHash() const
|
|||
(*this)[23] == OP_EQUALVERIFY &&
|
||||
(*this)[24] == OP_CHECKSIG);
|
||||
}
|
||||
bool CScript::IsPayToWitnessPubkeyHash() const
|
||||
{
|
||||
return (this->size() == 22 &&
|
||||
(*this)[0] == 0x00 &&
|
||||
(*this)[1] == 0x14);
|
||||
}
|
||||
|
||||
// END ELEMENTS
|
||||
//
|
||||
|
||||
|
|
|
|||
|
|
@ -538,6 +538,7 @@ public:
|
|||
unsigned int GetSigOpCount(const CScript& scriptSig) const;
|
||||
|
||||
bool IsPayToPubkeyHash() const;
|
||||
bool IsPayToWitnessPubkeyHash() const;
|
||||
bool IsPayToScriptHash() const;
|
||||
bool IsPayToWitnessScriptHash() const;
|
||||
bool IsWitnessProgram(int& version, std::vector<unsigned char>& program) const;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue