aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/mining.cpp
diff options
context:
space:
mode:
authorBen Woosley <[email protected]>2018-02-06 18:47:51 -0500
committerBen Woosley <[email protected]>2018-02-08 11:02:41 -0500
commitbb00c95c16f50c5dfab1aa8fbb6c873318a6acc8 (patch)
tree690d0a1dda3b3be64c6cb3200df795db58c992b9 /src/rpc/mining.cpp
parentAdd test for 'mempool min fee not met' rpc error (diff)
downloaddiscoin-bb00c95c16f50c5dfab1aa8fbb6c873318a6acc8.tar.xz
discoin-bb00c95c16f50c5dfab1aa8fbb6c873318a6acc8.zip
Consistently use FormatStateMessage in RPC error output
This will include the error code and debug output as well as the reason string. See #11955 for the motivation.
Diffstat (limited to 'src/rpc/mining.cpp')
-rw-r--r--src/rpc/mining.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp
index 69d0d12e8..32f8ca0c7 100644
--- a/src/rpc/mining.cpp
+++ b/src/rpc/mining.cpp
@@ -264,11 +264,11 @@ static UniValue BIP22ValidationResult(const CValidationState& state)
if (state.IsValid())
return NullUniValue;
- std::string strRejectReason = state.GetRejectReason();
if (state.IsError())
- throw JSONRPCError(RPC_VERIFY_ERROR, strRejectReason);
+ throw JSONRPCError(RPC_VERIFY_ERROR, FormatStateMessage(state));
if (state.IsInvalid())
{
+ std::string strRejectReason = state.GetRejectReason();
if (strRejectReason.empty())
return "rejected";
return strRejectReason;