aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/misc.cpp
diff options
context:
space:
mode:
authorPieter Wuille <[email protected]>2017-09-19 16:49:52 -0700
committerPieter Wuille <[email protected]>2018-02-19 18:55:20 -0800
commit32e69fa0df8fc1cfc8ac4f8381bc54b8f33e1c38 (patch)
treecd00b30d48911729cef8bd436797177bd8ebeb33 /src/rpc/misc.cpp
parentMerge #10579: [RPC] Split signrawtransaction into wallet and non-wallet RPC c... (diff)
downloaddiscoin-32e69fa0df8fc1cfc8ac4f8381bc54b8f33e1c38.tar.xz
discoin-32e69fa0df8fc1cfc8ac4f8381bc54b8f33e1c38.zip
Replace CBitcoinSecret with {Encode,Decode}Secret
Diffstat (limited to 'src/rpc/misc.cpp')
-rw-r--r--src/rpc/misc.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp
index 61bd59e9e..8d62fbe5c 100644
--- a/src/rpc/misc.cpp
+++ b/src/rpc/misc.cpp
@@ -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;