Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/avalanche.cpp
Show First 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | static UniValue addavalanchenode(const Config &config, | ||||
const NodeId nodeid = request.params[0].get_int64(); | const NodeId nodeid = request.params[0].get_int64(); | ||||
CPubKey key = ParsePubKey(request.params[1]); | CPubKey key = ParsePubKey(request.params[1]); | ||||
auto proof = std::make_shared<avalanche::Proof>(); | auto proof = std::make_shared<avalanche::Proof>(); | ||||
bilingual_str error; | bilingual_str error; | ||||
if (!avalanche::Proof::FromHex(*proof, request.params[2].get_str(), | if (!avalanche::Proof::FromHex(*proof, request.params[2].get_str(), | ||||
error)) { | error)) { | ||||
throw JSONRPCError(RPC_INVALID_PARAMETER, error.original); | throw JSONRPCError(RPC_DESERIALIZATION_ERROR, error.original); | ||||
} | } | ||||
if (key != proof->getMaster()) { | if (key != proof->getMaster()) { | ||||
// TODO: we want to provide a proper delegation. | // TODO: we want to provide a proper delegation. | ||||
return false; | return false; | ||||
} | } | ||||
const avalanche::ProofId &proofid = proof->getId(); | const avalanche::ProofId &proofid = proof->getId(); | ||||
▲ Show 20 Lines • Show All 542 Lines • Show Last 20 Lines |