mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
Refactor FormatStateMessage into ValidationState
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user