Changeset View
Changeset View
Standalone View
Standalone View
src/bitcoin-tx.cpp
Show First 20 Lines • Show All 605 Lines • ▼ Show 20 Lines | for (unsigned int previdx = 0; previdx < prevtxsObj.size(); previdx++) { | ||||
std::map<std::string, UniValue::VType> types = { | std::map<std::string, UniValue::VType> types = { | ||||
{"txid", UniValue::VSTR}, | {"txid", UniValue::VSTR}, | ||||
{"vout", UniValue::VNUM}, | {"vout", UniValue::VNUM}, | ||||
{"scriptPubKey", UniValue::VSTR}}; | {"scriptPubKey", UniValue::VSTR}}; | ||||
if (!prevOut.checkObject(types)) { | if (!prevOut.checkObject(types)) { | ||||
throw std::runtime_error("prevtxs internal object typecheck fail"); | throw std::runtime_error("prevtxs internal object typecheck fail"); | ||||
} | } | ||||
TxId txid(ParseHashUV(prevOut["txid"], "txid")); | TxId txid(ParseHashStr(prevOut["txid"].get_str(), "txid")); | ||||
int nOut = atoi(prevOut["vout"].getValStr()); | int nOut = atoi(prevOut["vout"].getValStr()); | ||||
if (nOut < 0) { | if (nOut < 0) { | ||||
throw std::runtime_error("vout must be positive"); | throw std::runtime_error("vout must be positive"); | ||||
} | } | ||||
COutPoint out(txid, nOut); | COutPoint out(txid, nOut); | ||||
std::vector<uint8_t> pkData( | std::vector<uint8_t> pkData( | ||||
▲ Show 20 Lines • Show All 259 Lines • Show Last 20 Lines |