mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-18 13:17:55 +02:00
Refactor FormatStateMessage into ValidationState
This commit is contained in:
parent
fe63d79eab
commit
0aed17ef28
15 changed files with 47 additions and 87 deletions
|
|
@ -28,7 +28,6 @@
|
|||
#include <util/fees.h>
|
||||
#include <util/strencodings.h>
|
||||
#include <util/system.h>
|
||||
#include <util/validation.h>
|
||||
#include <validation.h>
|
||||
#include <validationinterface.h>
|
||||
#include <versionbitsinfo.h>
|
||||
|
|
@ -307,7 +306,7 @@ static UniValue BIP22ValidationResult(const BlockValidationState& state)
|
|||
return NullUniValue;
|
||||
|
||||
if (state.IsError())
|
||||
throw JSONRPCError(RPC_VERIFY_ERROR, FormatStateMessage(state));
|
||||
throw JSONRPCError(RPC_VERIFY_ERROR, state.ToString());
|
||||
if (state.IsInvalid())
|
||||
{
|
||||
std::string strRejectReason = state.GetRejectReason();
|
||||
|
|
@ -823,7 +822,7 @@ static UniValue submitheader(const JSONRPCRequest& request)
|
|||
ProcessNewBlockHeaders({h}, state, Params());
|
||||
if (state.IsValid()) return NullUniValue;
|
||||
if (state.IsError()) {
|
||||
throw JSONRPCError(RPC_VERIFY_ERROR, FormatStateMessage(state));
|
||||
throw JSONRPCError(RPC_VERIFY_ERROR, state.ToString());
|
||||
}
|
||||
throw JSONRPCError(RPC_VERIFY_ERROR, state.GetRejectReason());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue