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

Method IsToPubKey

src/compressor.cpp:31–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29}
30
31bool CScriptCompressor::IsToPubKey(CPubKey& pubkey) const
32{
33 if (script.size() == 35 && script[0] == 33 && script[34] == OP_CHECKSIG && (script[1] == 0x02 || script[1] == 0x03)) {
34 pubkey.Set(&script[1], &script[34]);
35 return true;
36 }
37 if (script.size() == 67 && script[0] == 65 && script[66] == OP_CHECKSIG && script[1] == 0x04) {
38 pubkey.Set(&script[1], &script[66]);
39 return pubkey.IsFullyValid(); // if not fully valid, a case that would not be compressible
40 }
41 return false;
42}
43
44bool CScriptCompressor::Compress(std::vector<unsigned char>& out) const
45{

Callers

nothing calls this directly

Calls 3

IsFullyValidMethod · 0.80
sizeMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected