Replace CBitcoinSecret with {Encode,Decode}Secret

This commit is contained in:
Pieter Wuille
2017-09-19 16:49:52 -07:00
committed by Jack Grigg
parent b1d2a69908
commit f146029b0a
8 changed files with 58 additions and 98 deletions

View File

@@ -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);
}
}