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
238
238
(*this )[1 ] == 0x20 );
239
239
}
240
240
241
+ bool CScript::IsPayToTaproot () const
242
+ {
243
+ return (this ->size () == 34 &&
244
+ (*this )[0 ] == OP_1 &&
245
+ (*this )[1 ] == 0x20 );
246
+ }
247
+
241
248
// A witness program is any valid CScript that consists of a 1-byte push opcode
242
249
// followed by a data push between 2 and 40 bytes.
243
250
bool 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
554
554
555
555
bool IsPayToScriptHash () const ;
556
556
bool IsPayToWitnessScriptHash () const ;
557
+ // Extra-fast test for pay-to-taproot CScripts
558
+ bool IsPayToTaproot () const ;
557
559
bool IsWitnessProgram (int & version, std::vector<unsigned char >& program) const ;
558
560
559
561
/* * Called by IsStandardTx and P2SH/BIP62 VerifyScript (which makes it consensus-critical). */
You can’t perform that action at this time.
0 commit comments