Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/rawtransaction.cpp
Show First 20 Lines • Show All 485 Lines • ▼ Show 20 Lines | if (request.params.size() > 2 && !request.params[2].isNull()) { | ||||
if (nLockTime < 0 || nLockTime > std::numeric_limits<uint32_t>::max()) { | if (nLockTime < 0 || nLockTime > std::numeric_limits<uint32_t>::max()) { | ||||
throw JSONRPCError(RPC_INVALID_PARAMETER, | throw JSONRPCError(RPC_INVALID_PARAMETER, | ||||
"Invalid parameter, locktime out of range"); | "Invalid parameter, locktime out of range"); | ||||
} | } | ||||
rawTx.nLockTime = nLockTime; | rawTx.nLockTime = nLockTime; | ||||
} | } | ||||
for (unsigned int idx = 0; idx < inputs.size(); idx++) { | for (size_t idx = 0; idx < inputs.size(); idx++) { | ||||
const UniValue &input = inputs[idx]; | const UniValue &input = inputs[idx]; | ||||
const UniValue &o = input.get_obj(); | const UniValue &o = input.get_obj(); | ||||
uint256 txid = ParseHashO(o, "txid"); | uint256 txid = ParseHashO(o, "txid"); | ||||
const UniValue &vout_v = find_value(o, "vout"); | const UniValue &vout_v = find_value(o, "vout"); | ||||
if (!vout_v.isNum()) { | if (!vout_v.isNum()) { | ||||
throw JSONRPCError(RPC_INVALID_PARAMETER, | throw JSONRPCError(RPC_INVALID_PARAMETER, | ||||
Show All 13 Lines | for (size_t idx = 0; idx < inputs.size(); idx++) { | ||||
// Set the sequence number if passed in the parameters object. | // Set the sequence number if passed in the parameters object. | ||||
const UniValue &sequenceObj = find_value(o, "sequence"); | const UniValue &sequenceObj = find_value(o, "sequence"); | ||||
if (sequenceObj.isNum()) { | if (sequenceObj.isNum()) { | ||||
int64_t seqNr64 = sequenceObj.get_int64(); | int64_t seqNr64 = sequenceObj.get_int64(); | ||||
if (seqNr64 < 0 || seqNr64 > std::numeric_limits<uint32_t>::max()) { | if (seqNr64 < 0 || seqNr64 > std::numeric_limits<uint32_t>::max()) { | ||||
throw JSONRPCError( | throw JSONRPCError( | ||||
RPC_INVALID_PARAMETER, | RPC_INVALID_PARAMETER, | ||||
"Invalid parameter, sequence number is out of range"); | "Invalid parameter, sequence number is out of range"); | ||||
} else { | |||||
nSequence = (uint32_t)seqNr64; | |||||
} | } | ||||
nSequence = uint32_t(seqNr64); | |||||
} | } | ||||
CTxIn in(COutPoint(txid, nOutput), CScript(), nSequence); | CTxIn in(COutPoint(txid, nOutput), CScript(), nSequence); | ||||
rawTx.vin.push_back(in); | rawTx.vin.push_back(in); | ||||
} | } | ||||
std::set<CTxDestination> destinations; | std::set<CTxDestination> destinations; | ||||
std::vector<std::string> addrList = sendTo.getKeys(); | std::vector<std::string> addrList = sendTo.getKeys(); | ||||
for (const std::string &name_ : addrList) { | for (const std::string &name_ : addrList) { | ||||
if (name_ == "data") { | if (name_ == "data") { | ||||
std::vector<uint8_t> data = | std::vector<uint8_t> data = | ||||
▲ Show 20 Lines • Show All 647 Lines • Show Last 20 Lines |