diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2017-09-19 16:49:52 -0700 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2018-02-19 18:55:20 -0800 |
commit | 32e69fa0df8fc1cfc8ac4f8381bc54b8f33e1c38 (patch) | |
tree | cd00b30d48911729cef8bd436797177bd8ebeb33 /src/rpc/rawtransaction.cpp | |
parent | ffc6e48b2983189dc0ce7de0a038e5329bc07b1b (diff) |
Replace CBitcoinSecret with {Encode,Decode}Secret
Diffstat (limited to 'src/rpc/rawtransaction.cpp')
-rw-r--r-- | src/rpc/rawtransaction.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index 813afde4db..d87d733609 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -896,13 +896,9 @@ UniValue signrawtransactionwithkey(const JSONRPCRequest& request) const UniValue& keys = request.params[1].get_array(); for (unsigned int idx = 0; idx < keys.size(); ++idx) { UniValue k = keys[idx]; - CBitcoinSecret vchSecret; - if (!vchSecret.SetString(k.get_str())) { - 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"); } keystore.AddKey(key); } |