Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/avalanche.cpp
Show First 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | static UniValue addavalanchenode(const Config &config, | ||||
avalanche::Proof proof; | avalanche::Proof proof; | ||||
ss >> proof; | ss >> proof; | ||||
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; | ||||
} | } | ||||
if (proof.getStakes().size() > AVALANCHE_MAX_PROOF_STAKES) { | |||||
throw JSONRPCError(RPC_INVALID_PARAMS, | |||||
"Avalanche proof has too many UTXOs"); | |||||
} | |||||
return g_avalanche->addNode(nodeid, proof, | return g_avalanche->addNode(nodeid, proof, | ||||
avalanche::DelegationBuilder(proof).build()); | avalanche::DelegationBuilder(proof).build()); | ||||
} | } | ||||
static UniValue buildavalancheproof(const Config &config, | static UniValue buildavalancheproof(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"buildavalancheproof", | "buildavalancheproof", | ||||
▲ Show 20 Lines • Show All 231 Lines • Show Last 20 Lines |