diff --git a/src/script/script.cpp b/src/script/script.cpp index 8814139b2c..44973f465e 100644 --- a/src/script/script.cpp +++ b/src/script/script.cpp @@ -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 // diff --git a/src/script/script.h b/src/script/script.h index 7e6fdcf1d8..dfe1f8dc79 100644 --- a/src/script/script.h +++ b/src/script/script.h @@ -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& program) const;