mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 23:03:45 +01:00
policy: Add OP_1 <0x4e73> as a standard output type
These outputs are called anchors, and allow key-less anchor spends which are vsize-minimized versus keyed anchors which require larger outputs when creating and inputs when spending.
This commit is contained in:
@@ -204,6 +204,23 @@ unsigned int CScript::GetSigOpCount(const CScript& scriptSig) const
|
||||
return subscript.GetSigOpCount(true);
|
||||
}
|
||||
|
||||
bool CScript::IsPayToAnchor() const
|
||||
{
|
||||
return (this->size() == 4 &&
|
||||
(*this)[0] == OP_1 &&
|
||||
(*this)[1] == 0x02 &&
|
||||
(*this)[2] == 0x4e &&
|
||||
(*this)[3] == 0x73);
|
||||
}
|
||||
|
||||
bool CScript::IsPayToAnchor(int version, const std::vector<unsigned char>& program)
|
||||
{
|
||||
return version == 1 &&
|
||||
program.size() == 2 &&
|
||||
program[0] == 0x4e &&
|
||||
program[1] == 0x73;
|
||||
}
|
||||
|
||||
bool CScript::IsPayToScriptHash() const
|
||||
{
|
||||
// Extra-fast test for pay-to-script-hash CScripts:
|
||||
|
||||
Reference in New Issue
Block a user