Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/avalanche.cpp
Show First 20 Lines • Show All 181 Lines • ▼ Show 20 Lines | for (size_t i = 0; i < stakes.size(); i++) { | ||||
const TxId txid(ParseHashO(stake, "txid")); | const TxId txid(ParseHashO(stake, "txid")); | ||||
const COutPoint utxo(txid, nOut); | const COutPoint utxo(txid, nOut); | ||||
if (!stake.exists("amount")) { | if (!stake.exists("amount")) { | ||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Missing amount"); | throw JSONRPCError(RPC_INVALID_PARAMETER, "Missing amount"); | ||||
} | } | ||||
const Amount amount = AmountFromValue(find_value(stake, "amount")); | const Amount amount = 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), iscoinbase, | if (!pb.addUTXO(utxo, amount, uint32_t(height), iscoinbase, | ||||
std::move(key))) { | std::move(key))) { | ||||
▲ Show 20 Lines • Show All 303 Lines • Show Last 20 Lines |