Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/avalanche.cpp
Show First 20 Lines • Show All 306 Lines • ▼ Show 20 Lines | for (size_t i = 0; i < stakes.size(); i++) { | ||||
} | } | ||||
if (!pb.addUTXO(utxo, amount, uint32_t(height), iscoinbase, | if (!pb.addUTXO(utxo, amount, uint32_t(height), iscoinbase, | ||||
std::move(key))) { | std::move(key))) { | ||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Duplicated stake"); | throw JSONRPCError(RPC_INVALID_PARAMETER, "Duplicated stake"); | ||||
} | } | ||||
} | } | ||||
const avalanche::Proof proof = pb.build(); | const avalanche::ProofRef proof = pb.build(); | ||||
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); | CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); | ||||
ss << proof; | ss << *proof; | ||||
return HexStr(ss); | return HexStr(ss); | ||||
} | } | ||||
static UniValue decodeavalancheproof(const Config &config, | static UniValue decodeavalancheproof(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"decodeavalancheproof", | "decodeavalancheproof", | ||||
"Convert a serialized, hex-encoded proof, into JSON object. " | "Convert a serialized, hex-encoded proof, into JSON object. " | ||||
▲ Show 20 Lines • Show All 399 Lines • Show Last 20 Lines |