ss as HashWriter & Key Compatibility
@@ -431,15 +431,15 @@ Value verifymessage(const Array& params, bool fHelp)
if (fInvalid)
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Malformed base64 encoding");
- CDataStream ss(SER_GETHASH, 0);
+ CHashWriter ss(SER_GETHASH, 0);
ss << strMessageMagic;
ss << strMessage;
- CKey key;
- if (!key.SetCompactSignature(Hash(ss.begin(), ss.end()), vchSig))
+ CPubKey pubkey;
+ if (!pubkey.RecoverCompact(ss.GetHash(), vchSig))
return false;
- return (key.GetPubKey().GetID() == keyID);
+ return (pubkey.GetID() == keyID);
}
@@ -830,7 +830,7 @@ Value addmultisigaddress(const Array& params, bool fHelp)
if (!pwalletMain->GetPubKey(keyID, vchPubKey))
throw runtime_error(
strprintf("no full public key for address %s",ks.c_str()));
- if (!vchPubKey.IsValid() || !pubkeys[i].SetPubKey(vchPubKey))
+ if (!vchPubKey.IsFullyValid())
throw runtime_error(" Invalid public key: "+ks);
}
@@ -838,7 +838,7 @@ Value addmultisigaddress(const Array& params, bool fHelp)
else if (IsHex(ks))
{
CPubKey vchPubKey(ParseHex(ks));
- if (!vchPubKey.IsValid() || !pubkeys[i].SetPubKey(vchPubKey))
+ if (!vchPubKey.IsFullyValid())
throw runtime_error(" Invalid public key: "+ks);
}
else
