diff options
| author | Ben Woosley <[email protected]> | 2018-02-06 18:47:51 -0500 |
|---|---|---|
| committer | Ben Woosley <[email protected]> | 2018-02-08 11:02:41 -0500 |
| commit | bb00c95c16f50c5dfab1aa8fbb6c873318a6acc8 (patch) | |
| tree | 690d0a1dda3b3be64c6cb3200df795db58c992b9 /src/rpc/blockchain.cpp | |
| parent | Add test for 'mempool min fee not met' rpc error (diff) | |
| download | discoin-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/blockchain.cpp')
| -rw-r--r-- | src/rpc/blockchain.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 4276ad9ee..c880991b5 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -1434,7 +1434,7 @@ UniValue preciousblock(const JSONRPCRequest& request) PreciousBlock(state, Params(), pblockindex); if (!state.IsValid()) { - throw JSONRPCError(RPC_DATABASE_ERROR, state.GetRejectReason()); + throw JSONRPCError(RPC_DATABASE_ERROR, FormatStateMessage(state)); } return NullUniValue; @@ -1472,7 +1472,7 @@ UniValue invalidateblock(const JSONRPCRequest& request) } if (!state.IsValid()) { - throw JSONRPCError(RPC_DATABASE_ERROR, state.GetRejectReason()); + throw JSONRPCError(RPC_DATABASE_ERROR, FormatStateMessage(state)); } return NullUniValue; @@ -1509,7 +1509,7 @@ UniValue reconsiderblock(const JSONRPCRequest& request) ActivateBestChain(state, Params()); if (!state.IsValid()) { - throw JSONRPCError(RPC_DATABASE_ERROR, state.GetRejectReason()); + throw JSONRPCError(RPC_DATABASE_ERROR, FormatStateMessage(state)); } return NullUniValue; @@ -1563,7 +1563,7 @@ UniValue getchaintxstats(const JSONRPCRequest& request) pindex = chainActive.Tip(); } } - + assert(pindex != nullptr); if (request.params[0].isNull()) { |