MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / BIP22ValidationResult

Function BIP22ValidationResult

src/rpc/mining.cpp:326–342  ·  view source on GitHub ↗

NOTE: Assumes a conclusive result; if result is inconclusive, it must be handled by caller

Source from the content-addressed store, hash-verified

324
325// NOTE: Assumes a conclusive result; if result is inconclusive, it must be handled by caller
326static UniValue BIP22ValidationResult(const CValidationState& state)
327{
328 if (state.IsValid())
329 return NullUniValue;
330
331 if (state.IsError())
332 throw JSONRPCError(RPC_VERIFY_ERROR, FormatStateMessage(state));
333 if (state.IsInvalid())
334 {
335 std::string strRejectReason = state.GetRejectReason();
336 if (strRejectReason.empty())
337 return "rejected";
338 return strRejectReason;
339 }
340 // Should be impossible
341 return "valid?";
342}
343
344static std::string gbt_vb_name(const Consensus::DeploymentPos pos) {
345 const struct VBDeploymentInfo& vbinfo = VersionBitsDeploymentInfo[pos];

Callers 2

getblocktemplateFunction · 0.85
submitblockFunction · 0.85

Calls 7

JSONRPCErrorFunction · 0.85
FormatStateMessageFunction · 0.85
IsErrorMethod · 0.80
IsInvalidMethod · 0.80
GetRejectReasonMethod · 0.80
IsValidMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected