6#include <ipc/capnp/mining.capnp.proxy-types.h>
8#include <mp/proxy-types.h>
13 ipc::capnp::messages::BlockValidationState::Builder&& builder)
24 builder.setResult(
static_cast<int>(src.
GetResult()));
30 const ipc::capnp::messages::BlockValidationState::Reader& reader,
33 if (reader.getMode() == 0) {
34 assert(reader.getResult() == 0);
35 assert(reader.getRejectReason().size() == 0);
36 assert(reader.getDebugMessage().size() == 0);
37 }
else if (reader.getMode() == 1) {
39 }
else if (reader.getMode() == 2) {
40 assert(reader.getResult() == 0);
41 dest.
Error(reader.getRejectReason());
42 assert(reader.getDebugMessage().size() == 0);
std::string GetRejectReason() const
std::string GetDebugMessage() const
bool Error(const std::string &reject_reason)
bool Invalid(Result result, const std::string &reject_reason="", const std::string &debug_message="")
BlockValidationResult
A "reason" why a block was invalid, suitable for determining whether the provider of the block should...
Functions to serialize / deserialize common bitcoin types.
void CustomReadMessage(InvokeContext &invoke_context, const ipc::capnp::messages::BlockValidationState::Reader &reader, BlockValidationState &dest)
void CustomBuildMessage(InvokeContext &invoke_context, const BlockValidationState &src, ipc::capnp::messages::BlockValidationState::Builder &&builder)