mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 23:09:44 -04:00
script: Add IsPayToTaproot()
This commit is contained in:
parent
954d2913ac
commit
e7fa65d01e
2 changed files with 9 additions and 0 deletions
|
@ -238,6 +238,13 @@ bool CScript::IsPayToWitnessScriptHash() const
|
||||||
(*this)[1] == 0x20);
|
(*this)[1] == 0x20);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CScript::IsPayToTaproot() const
|
||||||
|
{
|
||||||
|
return (this->size() == 34 &&
|
||||||
|
(*this)[0] == OP_1 &&
|
||||||
|
(*this)[1] == 0x20);
|
||||||
|
}
|
||||||
|
|
||||||
// A witness program is any valid CScript that consists of a 1-byte push opcode
|
// A witness program is any valid CScript that consists of a 1-byte push opcode
|
||||||
// followed by a data push between 2 and 40 bytes.
|
// followed by a data push between 2 and 40 bytes.
|
||||||
bool CScript::IsWitnessProgram(int& version, std::vector<unsigned char>& program) const
|
bool CScript::IsWitnessProgram(int& version, std::vector<unsigned char>& program) const
|
||||||
|
|
|
@ -556,6 +556,8 @@ public:
|
||||||
bool IsPayToWitnessScriptHash() const;
|
bool IsPayToWitnessScriptHash() const;
|
||||||
bool IsWitnessProgram(int& version, std::vector<unsigned char>& program) const;
|
bool IsWitnessProgram(int& version, std::vector<unsigned char>& program) const;
|
||||||
|
|
||||||
|
bool IsPayToTaproot() const;
|
||||||
|
|
||||||
/** Called by IsStandardTx and P2SH/BIP62 VerifyScript (which makes it consensus-critical). */
|
/** Called by IsStandardTx and P2SH/BIP62 VerifyScript (which makes it consensus-critical). */
|
||||||
bool IsPushOnly(const_iterator pc) const;
|
bool IsPushOnly(const_iterator pc) const;
|
||||||
bool IsPushOnly() const;
|
bool IsPushOnly() const;
|
||||||
|
|
Loading…
Add table
Reference in a new issue