const unsigned char *vchZero = NULL;
+CScriptID::CScriptID(const CScript& in) : uint160(Hash160(in.begin(), in.end()))
+{
+}
+
void CKey::SetCompressedPubKey(bool fCompressed)
{
EC_KEY_set_conv_form(pkey, fCompressed ? POINT_CONVERSION_COMPRESSED : POINT_CONVERSION_UNCOMPRESSED);
bnHash.setuint160(Hash160(vchLr));
CPoint pointH;
- pointH.setPubKey(pubKeyH);
+ if (!pointH.setPubKey(pubKeyH)) {
+ throw key_error("CMalleablePubKey::GetVariant() : Unable to decode H value");
+ }
CPoint P;
// Calculate P = Hash(L*r)*G + H
}
std::vector<unsigned char> vchResult;
- P.getBytes(vchResult);
+ if (!P.getBytes(vchResult)) {
+ throw key_error("CMalleablePubKey::GetVariant() : Unable to convert P value");
+ }
vchPubKeyVariant = CPubKey(vchResult);
}