Replace CBitcoinSecret with {Encode,Decode}Secret
This commit is contained in:
committed by
Jack Grigg
parent
b1d2a69908
commit
f146029b0a
@@ -777,13 +777,9 @@ UniValue signrawtransaction(const UniValue& params, bool fHelp)
|
||||
UniValue keys = params[2].get_array();
|
||||
for (size_t idx = 0; idx < keys.size(); idx++) {
|
||||
UniValue k = keys[idx];
|
||||
CBitcoinSecret vchSecret;
|
||||
bool fGood = vchSecret.SetString(k.get_str());
|
||||
if (!fGood)
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid private key");
|
||||
CKey key = vchSecret.GetKey();
|
||||
CKey key = DecodeSecret(k.get_str());
|
||||
if (!key.IsValid())
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Private key outside allowed range");
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid private key");
|
||||
tempKeystore.AddKey(key);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user