File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -238,6 +238,13 @@ bool CScript::IsPayToWitnessScriptHash() const
238238 (*this )[1 ] == 0x20 );
239239}
240240
241+ bool CScript::IsPayToTaproot () const
242+ {
243+ return (this ->size () == 34 &&
244+ (*this )[0 ] == OP_1 &&
245+ (*this )[1 ] == 0x20 );
246+ }
247+
241248// A witness program is any valid CScript that consists of a 1-byte push opcode
242249// followed by a data push between 2 and 40 bytes.
243250bool CScript::IsWitnessProgram (int & version, std::vector<unsigned char >& program) const
Original file line number Diff line number Diff line change @@ -554,6 +554,8 @@ class CScript : public CScriptBase
554554
555555 bool IsPayToScriptHash () const ;
556556 bool IsPayToWitnessScriptHash () const ;
557+ // Extra-fast test for pay-to-taproot CScripts
558+ bool IsPayToTaproot () const ;
557559 bool IsWitnessProgram (int & version, std::vector<unsigned char >& program) const ;
558560
559561 /* * Called by IsStandardTx and P2SH/BIP62 VerifyScript (which makes it consensus-critical). */
You can’t perform that action at this time.
0 commit comments