MCPcopy Create free account
hub / github.com/LUX-Core/lux / CScriptVisitor

Class CScriptVisitor

src/script/standard.cpp:401–445  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

399namespace
400{
401class CScriptVisitor : public boost::static_visitor<bool>
402{
403private:
404 CScript *script;
405public:
406 explicit CScriptVisitor(CScript *scriptin) { script = scriptin; }
407
408 bool operator()(const CNoDestination &dest) const {
409 script->clear();
410 return false;
411 }
412
413 bool operator()(const CKeyID &keyID) const {
414 script->clear();
415 *script << OP_DUP << OP_HASH160 << ToByteVector(keyID) << OP_EQUALVERIFY << OP_CHECKSIG;
416 return true;
417 }
418
419 bool operator()(const CScriptID &scriptID) const {
420 script->clear();
421 *script << OP_HASH160 << ToByteVector(scriptID) << OP_EQUAL;
422 return true;
423 }
424
425 bool operator()(const WitnessV0KeyHash& id) const
426 {
427 script->clear();
428 *script << OP_0 << ToByteVector(id);
429 return true;
430 }
431
432 bool operator()(const WitnessV0ScriptHash& id) const
433 {
434 script->clear();
435 *script << OP_0 << ToByteVector(id);
436 return true;
437 }
438
439 bool operator()(const WitnessUnknown& id) const
440 {
441 script->clear();
442 *script << CScript::EncodeOP_N(id.version) << std::vector<unsigned char>(id.program, id.program + id.length);
443 return true;
444 }
445};
446}
447
448uint160 GetHashForDestination(const CTxDestination& dest)

Callers 2

GetHashForDestinationFunction · 0.85
GetScriptForDestinationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected