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

Function BIP22ValidationResult

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

615
616// NOTE: Assumes a conclusive result; if result is inconclusive, it must be handled by caller
617static UniValue BIP22ValidationResult(const BlockValidationState& state)
618{
619 if (state.IsValid())
620 return UniValue::VNULL;
621
622 if (state.IsError())
623 throw JSONRPCError(RPC_VERIFY_ERROR, state.ToString());
624 if (state.IsInvalid())
625 {
626 std::string strRejectReason = state.GetRejectReason();
627 if (strRejectReason.empty())
628 return "rejected";
629 return strRejectReason;
630 }
631 // Should be impossible
632 return "valid?";
633}
634
635// Prefix rule name with ! if not optional, see BIP9
636static std::string gbt_rule_value(const std::string& name, bool gbt_optional_rule)

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