MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / ExtractPubKey

Function ExtractPubKey

src/keystore.cpp:124–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 2

AddWatchOnlyMethod · 0.85
RemoveWatchOnlyMethod · 0.85

Calls 4

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

Tested by

no test coverage detected