Changeset View
Changeset View
Standalone View
Standalone View
src/bitcoin-tx.cpp
Show First 20 Lines • Show All 343 Lines • ▼ Show 20 Lines | static void MutateTxAddOutPubKey(CMutableTransaction &tx, | ||||
if (vStrInputParts.size() == 3) { | if (vStrInputParts.size() == 3) { | ||||
std::string flags = vStrInputParts[2]; | std::string flags = vStrInputParts[2]; | ||||
bScriptHash = (flags.find('S') != std::string::npos); | bScriptHash = (flags.find('S') != std::string::npos); | ||||
} | } | ||||
if (bScriptHash) { | if (bScriptHash) { | ||||
// Get the ID for the script, and then construct a P2SH destination for | // Get the ID for the script, and then construct a P2SH destination for | ||||
// it. | // it. | ||||
scriptPubKey = GetScriptForDestination(CScriptID(scriptPubKey)); | scriptPubKey = GetScriptForDestination(ScriptHash(scriptPubKey)); | ||||
} | } | ||||
// construct TxOut, append to transaction output list | // construct TxOut, append to transaction output list | ||||
CTxOut txout(value, scriptPubKey); | CTxOut txout(value, scriptPubKey); | ||||
tx.vout.push_back(txout); | tx.vout.push_back(txout); | ||||
} | } | ||||
static void MutateTxAddOutMultiSig(CMutableTransaction &tx, | static void MutateTxAddOutMultiSig(CMutableTransaction &tx, | ||||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | static void MutateTxAddOutMultiSig(CMutableTransaction &tx, | ||||
if (bScriptHash) { | if (bScriptHash) { | ||||
if (scriptPubKey.size() > MAX_SCRIPT_ELEMENT_SIZE) { | if (scriptPubKey.size() > MAX_SCRIPT_ELEMENT_SIZE) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
strprintf("redeemScript exceeds size limit: %d > %d", | strprintf("redeemScript exceeds size limit: %d > %d", | ||||
scriptPubKey.size(), MAX_SCRIPT_ELEMENT_SIZE)); | scriptPubKey.size(), MAX_SCRIPT_ELEMENT_SIZE)); | ||||
} | } | ||||
// Get the ID for the script, and then construct a P2SH destination for | // Get the ID for the script, and then construct a P2SH destination for | ||||
// it. | // it. | ||||
scriptPubKey = GetScriptForDestination(CScriptID(scriptPubKey)); | scriptPubKey = GetScriptForDestination(ScriptHash(scriptPubKey)); | ||||
} | } | ||||
// construct TxOut, append to transaction output list | // construct TxOut, append to transaction output list | ||||
CTxOut txout(value, scriptPubKey); | CTxOut txout(value, scriptPubKey); | ||||
tx.vout.push_back(txout); | tx.vout.push_back(txout); | ||||
} | } | ||||
static void MutateTxAddOutData(CMutableTransaction &tx, | static void MutateTxAddOutData(CMutableTransaction &tx, | ||||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | static void MutateTxAddOutScript(CMutableTransaction &tx, | ||||
} | } | ||||
if (bScriptHash) { | if (bScriptHash) { | ||||
if (scriptPubKey.size() > MAX_SCRIPT_ELEMENT_SIZE) { | if (scriptPubKey.size() > MAX_SCRIPT_ELEMENT_SIZE) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
strprintf("redeemScript exceeds size limit: %d > %d", | strprintf("redeemScript exceeds size limit: %d > %d", | ||||
scriptPubKey.size(), MAX_SCRIPT_ELEMENT_SIZE)); | scriptPubKey.size(), MAX_SCRIPT_ELEMENT_SIZE)); | ||||
} | } | ||||
scriptPubKey = GetScriptForDestination(CScriptID(scriptPubKey)); | scriptPubKey = GetScriptForDestination(ScriptHash(scriptPubKey)); | ||||
} | } | ||||
// construct TxOut, append to transaction output list | // construct TxOut, append to transaction output list | ||||
CTxOut txout(value, scriptPubKey); | CTxOut txout(value, scriptPubKey); | ||||
tx.vout.push_back(txout); | tx.vout.push_back(txout); | ||||
} | } | ||||
static void MutateTxDelInput(CMutableTransaction &tx, | static void MutateTxDelInput(CMutableTransaction &tx, | ||||
▲ Show 20 Lines • Show All 406 Lines • Show Last 20 Lines |