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

Function BIP22ValidationResult

src/rpcmining.cpp:305–321  ·  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

303
304// NOTE: Assumes a conclusive result; if result is inconclusive, it must be handled by caller
305static UniValue BIP22ValidationResult(const CValidationState& state)
306{
307 if (state.IsValid())
308 return NullUniValue;
309
310 std::string strRejectReason = state.GetRejectReason();
311 if (state.IsError())
312 throw JSONRPCError(RPC_VERIFY_ERROR, strRejectReason);
313 if (state.IsInvalid())
314 {
315 if (strRejectReason.empty())
316 return "rejected";
317 return strRejectReason;
318 }
319 // Should be impossible
320 return "valid?";
321}
322
323UniValue getblocktemplate(const UniValue& params, bool fHelp)
324{

Callers 2

getblocktemplateFunction · 0.85
submitblockFunction · 0.85

Calls 6

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

Tested by

no test coverage detected