Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/avalanche.cpp
Show First 20 Lines • Show All 177 Lines • ▼ Show 20 Lines | for (size_t i = 0; i < stakes.size(); i++) { | ||||
const Amount amount = AmountFromValue(find_value(stake, "amount")); | const Amount amount = AmountFromValue(find_value(stake, "amount")); | ||||
const UniValue &iscbparam = find_value(stake, "iscoinbase"); | const UniValue &iscbparam = find_value(stake, "iscoinbase"); | ||||
const bool iscoinbase = | const bool iscoinbase = | ||||
iscbparam.isNull() ? false : iscbparam.get_bool(); | iscbparam.isNull() ? false : iscbparam.get_bool(); | ||||
CKey key = DecodeSecret(find_value(stake, "privatekey").get_str()); | CKey key = DecodeSecret(find_value(stake, "privatekey").get_str()); | ||||
if (!pb.addUTXO(utxo, amount, uint32_t(height) << 1 | iscoinbase, | if (!pb.addUTXO(utxo, amount, uint32_t(height), iscoinbase, | ||||
std::move(key))) { | std::move(key))) { | ||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid private key"); | throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid private key"); | ||||
} | } | ||||
} | } | ||||
const avalanche::Proof proof = pb.build(); | const avalanche::Proof proof = pb.build(); | ||||
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); | CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); | ||||
Show All 19 Lines |