Changeset View
Changeset View
Standalone View
Standalone View
src/keystore.cpp
Show First 20 Lines • Show All 112 Lines • ▼ Show 20 Lines | bool CBasicKeyStore::GetCScript(const CScriptID &hash, | ||||
return false; | return false; | ||||
} | } | ||||
static bool ExtractPubKey(const CScript &dest, CPubKey &pubKeyOut) { | static bool ExtractPubKey(const CScript &dest, CPubKey &pubKeyOut) { | ||||
// TODO: Use Solver to extract this? | // TODO: Use Solver to extract this? | ||||
CScript::const_iterator pc = dest.begin(); | CScript::const_iterator pc = dest.begin(); | ||||
opcodetype opcode; | opcodetype opcode; | ||||
std::vector<uint8_t> vch; | std::vector<uint8_t> vch; | ||||
if (!dest.GetOp(pc, opcode, vch) || vch.size() < 33 || vch.size() > 65) { | if (!dest.GetOp(pc, opcode, vch) || !CPubKey::ValidSize(vch)) { | ||||
return false; | return false; | ||||
} | } | ||||
pubKeyOut = CPubKey(vch); | pubKeyOut = CPubKey(vch); | ||||
if (!pubKeyOut.IsFullyValid()) { | if (!pubKeyOut.IsFullyValid()) { | ||||
return false; | return false; | ||||
} | } | ||||
if (!dest.GetOp(pc, opcode, vch) || opcode != OP_CHECKSIG || | if (!dest.GetOp(pc, opcode, vch) || opcode != OP_CHECKSIG || | ||||
dest.GetOp(pc, opcode, vch)) { | dest.GetOp(pc, opcode, vch)) { | ||||
▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines |