Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/avalanche.cpp
Show First 20 Lines • Show All 457 Lines • ▼ Show 20 Lines | static UniValue verifyavalancheproof(const Config &config, | ||||
} | } | ||||
.Check(request); | .Check(request); | ||||
RPCTypeCheck(request.params, {UniValue::VSTR}); | RPCTypeCheck(request.params, {UniValue::VSTR}); | ||||
avalanche::Proof proof; | avalanche::Proof proof; | ||||
bilingual_str error; | bilingual_str error; | ||||
if (!avalanche::Proof::FromHex(proof, request.params[0].get_str(), error)) { | if (!avalanche::Proof::FromHex(proof, request.params[0].get_str(), error)) { | ||||
throw JSONRPCError(RPC_INVALID_PARAMETER, error.original); | throw JSONRPCError(RPC_DESERIALIZATION_ERROR, error.original); | ||||
} | } | ||||
NodeContext &node = EnsureNodeContext(request.context); | NodeContext &node = EnsureNodeContext(request.context); | ||||
avalanche::ProofValidationState state; | avalanche::ProofValidationState state; | ||||
{ | { | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
if (!proof.verify(state, | if (!proof.verify(state, | ||||
Show All 28 Lines |