Changeset View
Changeset View
Standalone View
Standalone View
src/bitcoin-tx.cpp
Show First 20 Lines • Show All 236 Lines • ▼ Show 20 Lines | static void MutateTxAddInput(CMutableTransaction &tx, | ||||
} | } | ||||
// extract and validate TXID | // extract and validate TXID | ||||
std::string strTxid = vStrInputParts[0]; | std::string strTxid = vStrInputParts[0]; | ||||
if ((strTxid.size() != 64) || !IsHex(strTxid)) { | if ((strTxid.size() != 64) || !IsHex(strTxid)) { | ||||
throw std::runtime_error("invalid TX input txid"); | throw std::runtime_error("invalid TX input txid"); | ||||
} | } | ||||
uint256 txid(uint256S(strTxid)); | TxId txid(uint256S(strTxid)); | ||||
static const unsigned int minTxOutSz = 9; | static const unsigned int minTxOutSz = 9; | ||||
static const unsigned int maxVout = MAX_TX_SIZE / minTxOutSz; | static const unsigned int maxVout = MAX_TX_SIZE / minTxOutSz; | ||||
// extract and validate vout | // extract and validate vout | ||||
std::string strVout = vStrInputParts[1]; | std::string strVout = vStrInputParts[1]; | ||||
int vout = atoi(strVout); | int vout = atoi(strVout); | ||||
if ((vout < 0) || (vout > (int)maxVout)) { | if ((vout < 0) || (vout > (int)maxVout)) { | ||||
▲ Show 20 Lines • Show All 651 Lines • Show Last 20 Lines |