Add IsPayToWitnessPubkeyHash convenience function

This commit is contained in:
Gregory Sanders 2019-01-03 16:27:12 -05:00
parent 1241343bd5
commit 71acfb359b
2 changed files with 8 additions and 0 deletions

View file

@ -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
//