Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/rawtransaction_util.cpp
Show First 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | for (size_t idx = 0; idx < inputs.size(); idx++) { | ||||
if (!vout_v.isNum()) { | if (!vout_v.isNum()) { | ||||
throw JSONRPCError(RPC_INVALID_PARAMETER, | throw JSONRPCError(RPC_INVALID_PARAMETER, | ||||
"Invalid parameter, vout must be a number"); | "Invalid parameter, vout must be a number"); | ||||
} | } | ||||
int nOutput = vout_v.get_int(); | int nOutput = vout_v.get_int(); | ||||
if (nOutput < 0) { | if (nOutput < 0) { | ||||
throw JSONRPCError(RPC_INVALID_PARAMETER, | throw JSONRPCError(RPC_INVALID_PARAMETER, | ||||
"Invalid parameter, vout must be positive"); | "Invalid parameter, vout cannot be negative"); | ||||
} | } | ||||
uint32_t nSequence = | uint32_t nSequence = | ||||
(rawTx.nLockTime ? std::numeric_limits<uint32_t>::max() - 1 | (rawTx.nLockTime ? std::numeric_limits<uint32_t>::max() - 1 | ||||
: std::numeric_limits<uint32_t>::max()); | : std::numeric_limits<uint32_t>::max()); | ||||
// 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"); | ||||
▲ Show 20 Lines • Show All 114 Lines • ▼ Show 20 Lines | if (!prevTxsUnival.isNull()) { | ||||
// (which are valid JSON) | // (which are valid JSON) | ||||
}); | }); | ||||
TxId txid(ParseHashO(prevOut, "txid")); | TxId txid(ParseHashO(prevOut, "txid")); | ||||
int nOut = find_value(prevOut, "vout").get_int(); | int nOut = find_value(prevOut, "vout").get_int(); | ||||
if (nOut < 0) { | if (nOut < 0) { | ||||
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, | throw JSONRPCError(RPC_DESERIALIZATION_ERROR, | ||||
"vout must be positive"); | "vout cannot be negative"); | ||||
} | } | ||||
COutPoint out(txid, nOut); | COutPoint out(txid, nOut); | ||||
std::vector<uint8_t> pkData(ParseHexO(prevOut, "scriptPubKey")); | std::vector<uint8_t> pkData(ParseHexO(prevOut, "scriptPubKey")); | ||||
CScript scriptPubKey(pkData.begin(), pkData.end()); | CScript scriptPubKey(pkData.begin(), pkData.end()); | ||||
{ | { | ||||
auto coin = coins.find(out); | auto coin = coins.find(out); | ||||
▲ Show 20 Lines • Show All 93 Lines • Show Last 20 Lines |