MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / CScriptVisitor

Class CScriptVisitor

src/addresstype.cpp:108–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106
107namespace {
108class CScriptVisitor
109{
110public:
111 CScript operator()(const CNoDestination& dest) const
112 {
113 return dest.GetScript();
114 }
115
116 CScript operator()(const PubKeyDestination& dest) const
117 {
118 return CScript() << ToByteVector(dest.GetPubKey()) << OP_CHECKSIG;
119 }
120
121 CScript operator()(const PKHash& keyID) const
122 {
123 return CScript() << OP_DUP << OP_HASH160 << ToByteVector(keyID) << OP_EQUALVERIFY << OP_CHECKSIG;
124 }
125
126 CScript operator()(const ScriptHash& scriptID) const
127 {
128 return CScript() << OP_HASH160 << ToByteVector(scriptID) << OP_EQUAL;
129 }
130
131 CScript operator()(const WitnessV0KeyHash& id) const
132 {
133 return CScript() << OP_0 << ToByteVector(id);
134 }
135
136 CScript operator()(const WitnessV0ScriptHash& id) const
137 {
138 return CScript() << OP_0 << ToByteVector(id);
139 }
140
141 CScript operator()(const WitnessV1Taproot& tap) const
142 {
143 return CScript() << OP_1 << ToByteVector(tap);
144 }
145
146 CScript operator()(const WitnessUnknown& id) const
147 {
148 return CScript() << CScript::EncodeOP_N(id.GetWitnessVersion()) << id.GetWitnessProgram();
149 }
150};
151
152class ValidDestinationVisitor
153{

Callers 1

GetScriptForDestinationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected