| 17 | BOOST_FIXTURE_TEST_SUITE(rbf_tests, BasicTestingSetup) |
| 18 | |
| 19 | static inline CTransactionRef make_tx(const std::vector<CTransactionRef>& inputs, |
| 20 | const std::vector<CAmount>& output_values) |
| 21 | { |
| 22 | CMutableTransaction tx = CMutableTransaction(); |
| 23 | tx.vin.resize(inputs.size()); |
| 24 | tx.vout.resize(output_values.size()); |
| 25 | for (size_t i = 0; i < inputs.size(); ++i) { |
| 26 | tx.vin[i].prevout.hash = inputs[i]->GetHash(); |
| 27 | tx.vin[i].prevout.n = 0; |
| 28 | // Add a witness so wtxid != txid |
| 29 | CScriptWitness witness; |
| 30 | witness.stack.emplace_back(i + 10); |
| 31 | tx.vin[i].scriptWitness = witness; |
| 32 | } |
| 33 | for (size_t i = 0; i < output_values.size(); ++i) { |
| 34 | tx.vout[i].scriptPubKey = CScript() << OP_11 << OP_EQUAL; |
| 35 | tx.vout[i].nValue = output_values[i]; |
| 36 | } |
| 37 | return MakeTransactionRef(tx); |
| 38 | } |
| 39 | |
| 40 | static CTransactionRef add_descendants(const CTransactionRef& tx, int32_t num_descendants, CTxMemPool& pool) |
| 41 | EXCLUSIVE_LOCKS_REQUIRED(::cs_main, pool.cs) |
no test coverage detected