mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-06 10:42:46 +01:00
Replace CBitcoinSecret with {Encode,Decode}Secret
This commit is contained in:
@@ -224,13 +224,10 @@ UniValue signmessagewithprivkey(const JSONRPCRequest& request)
|
||||
std::string strPrivkey = request.params[0].get_str();
|
||||
std::string strMessage = request.params[1].get_str();
|
||||
|
||||
CBitcoinSecret vchSecret;
|
||||
bool fGood = vchSecret.SetString(strPrivkey);
|
||||
if (!fGood)
|
||||
CKey key = DecodeSecret(strPrivkey);
|
||||
if (!key.IsValid()) {
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid private key");
|
||||
CKey key = vchSecret.GetKey();
|
||||
if (!key.IsValid())
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Private key outside allowed range");
|
||||
}
|
||||
|
||||
CHashWriter ss(SER_GETHASH, 0);
|
||||
ss << strMessageMagic;
|
||||
|
||||
Reference in New Issue
Block a user