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

Function ExtractPubKey

src/keystore.cpp:123–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123static bool ExtractPubKey(const CScript &dest, CPubKey& pubKeyOut)
124{
125 //TODO: Use Solver to extract this?
126 CScript::const_iterator pc = dest.begin();
127 opcodetype opcode;
128 std::vector<unsigned char> vch;
129 if (!dest.GetOp(pc, opcode, vch) || vch.size() < 33 || vch.size() > 65)
130 return false;
131 pubKeyOut = CPubKey(vch);
132 if (!pubKeyOut.IsFullyValid())
133 return false;
134 if (!dest.GetOp(pc, opcode, vch) || opcode != OP_CHECKSIG || dest.GetOp(pc, opcode, vch))
135 return false;
136 return true;
137}
138
139bool CBasicKeyStore::AddWatchOnly(const CScript &dest)
140{

Callers 2

AddWatchOnlyMethod · 0.85
RemoveWatchOnlyMethod · 0.85

Calls 5

GetOpMethod · 0.80
IsFullyValidMethod · 0.80
CPubKeyClass · 0.70
beginMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected