MCPcopy Create free account
hub / github.com/ElementsProject/elements / BIP22ValidationResult

Function BIP22ValidationResult

src/rpc/mining.cpp:518–534  ·  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

516
517// NOTE: Assumes a conclusive result; if result is inconclusive, it must be handled by caller
518static UniValue BIP22ValidationResult(const BlockValidationState& state)
519{
520 if (state.IsValid())
521 return NullUniValue;
522
523 if (state.IsError())
524 throw JSONRPCError(RPC_VERIFY_ERROR, state.ToString());
525 if (state.IsInvalid())
526 {
527 std::string strRejectReason = state.GetRejectReason();
528 if (strRejectReason.empty())
529 return "rejected";
530 return strRejectReason;
531 }
532 // Should be impossible
533 return "valid?";
534}
535
536static std::string gbt_vb_name(const Consensus::DeploymentPos pos) {
537 const struct VBDeploymentInfo& vbinfo = VersionBitsDeploymentInfo[pos];

Callers 2

getblocktemplateFunction · 0.85
submitblockFunction · 0.85

Calls 7

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

Tested by

no test coverage detected