MCPcopy Create free account
hub / github.com/ElementsProject/elements / MutateTxDelInput

Function MutateTxDelInput

src/bitcoin-tx.cpp:539–549  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

537}
538
539static void MutateTxDelInput(CMutableTransaction& tx, const std::string& strInIdx)
540{
541 // parse requested deletion index
542 int64_t inIdx;
543 if (!ParseInt64(strInIdx, &inIdx) || inIdx < 0 || inIdx >= static_cast<int64_t>(tx.vin.size())) {
544 throw std::runtime_error("Invalid TX input index '" + strInIdx + "'");
545 }
546
547 // delete input from transaction
548 tx.vin.erase(tx.vin.begin() + inIdx);
549}
550
551static void MutateTxDelOutput(CMutableTransaction& tx, const std::string& strOutIdx)
552{

Callers 1

MutateTxFunction · 0.85

Calls 4

ParseInt64Function · 0.50
sizeMethod · 0.45
eraseMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected