diff options
author | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2020-03-29 16:45:13 +0200 |
---|---|---|
committer | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2020-08-29 10:42:43 +0200 |
commit | e62f0c71f10def124b1c1219d790cef246a32c3e (patch) | |
tree | 6bbcc8a4cea53112aab1abaf152c0a6a9b006e94 /src/rpc | |
parent | baf9cedee89f34a391b11240984c27b162bccdba (diff) | |
download | bitcoin-e62f0c71f10def124b1c1219d790cef246a32c3e.tar.xz |
rpc: fix {sign,message}verify RPC errors for invalid address/signature
Diffstat (limited to 'src/rpc')
-rw-r--r-- | src/rpc/misc.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index 0c982317f5..e8f8a9837f 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -300,11 +300,11 @@ static RPCHelpMan verifymessage() switch (MessageVerify(strAddress, strSign, strMessage)) { case MessageVerificationResult::ERR_INVALID_ADDRESS: - throw JSONRPCError(RPC_TYPE_ERROR, "Invalid address"); + throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid address"); case MessageVerificationResult::ERR_ADDRESS_NO_KEY: throw JSONRPCError(RPC_TYPE_ERROR, "Address does not refer to key"); case MessageVerificationResult::ERR_MALFORMED_SIGNATURE: - throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Malformed base64 encoding"); + throw JSONRPCError(RPC_TYPE_ERROR, "Malformed base64 encoding"); case MessageVerificationResult::ERR_PUBKEY_NOT_RECOVERED: case MessageVerificationResult::ERR_NOT_SIGNED: return false; |