MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / MutateTxRBFOptIn

Function MutateTxRBFOptIn

src/bitcoin-tx.cpp:211–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

209}
210
211static void MutateTxRBFOptIn(CMutableTransaction& tx, const std::string& strInIdx)
212{
213 // parse requested index
214 int64_t inIdx;
215 if (!ParseInt64(strInIdx, &inIdx) || inIdx < 0 || inIdx >= static_cast<int64_t>(tx.vin.size())) {
216 throw std::runtime_error("Invalid TX input index '" + strInIdx + "'");
217 }
218
219 // set the nSequence to MAX_INT - 2 (= RBF opt in flag)
220 int cnt = 0;
221 for (CTxIn& txin : tx.vin) {
222 if (strInIdx == "" || cnt == inIdx) {
223 if (txin.nSequence > MAX_BIP125_RBF_SEQUENCE) {
224 txin.nSequence = MAX_BIP125_RBF_SEQUENCE;
225 }
226 }
227 ++cnt;
228 }
229}
230
231static void MutateTxAddInput(CMutableTransaction& tx, const std::string& strInput)
232{

Callers 1

MutateTxFunction · 0.85

Calls 2

ParseInt64Function · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected