Assert CPubKey::ValidLength to the pubkey's header-relevent size
Previously this was an inline test where the specificity was probably judged overly specific. As a class method it makes sense to maintain consistency. And replace some magic values with their constant equivalents.
This commit is contained in:
+1
-1
@@ -131,7 +131,7 @@ static bool ExtractPubKey(const CScript &dest, CPubKey& pubKeyOut)
|
||||
CScript::const_iterator pc = dest.begin();
|
||||
opcodetype opcode;
|
||||
std::vector<unsigned char> vch;
|
||||
if (!dest.GetOp(pc, opcode, vch) || vch.size() < 33 || vch.size() > 65)
|
||||
if (!dest.GetOp(pc, opcode, vch) || !CPubKey::ValidSize(vch))
|
||||
return false;
|
||||
pubKeyOut = CPubKey(vch);
|
||||
if (!pubKeyOut.IsFullyValid())
|
||||
|
||||
Reference in New Issue
Block a user