Make one OutputGroup with a single UTXO that either has a given effective value (default) or a given amount (`is_eff_value = false`). */
| 61 | |
| 62 | /** Make one OutputGroup with a single UTXO that either has a given effective value (default) or a given amount (`is_eff_value = false`). */ |
| 63 | static OutputGroup MakeCoin(const CAmount& amount, bool is_eff_value = true, CoinSelectionParams cs_params = default_cs_params, int custom_spending_vsize = P2WPKH_INPUT_VSIZE) |
| 64 | { |
| 65 | // Always assume that we only have one input |
| 66 | CMutableTransaction tx; |
| 67 | tx.vout.resize(1); |
| 68 | CAmount fees = cs_params.m_effective_feerate.GetFee(custom_spending_vsize); |
| 69 | tx.vout[0].nValue = amount + int(is_eff_value) * fees; |
| 70 | tx.nLockTime = next_lock_time++; // so all transactions get different hashes |
| 71 | OutputGroup group(cs_params); |
| 72 | group.Insert(std::make_shared<COutput>(COutPoint(tx.GetHash(), 0), tx.vout.at(0), /*depth=*/1, /*input_bytes=*/custom_spending_vsize, /*solvable=*/true, /*safe=*/true, /*time=*/0, /*from_me=*/false, /*fees=*/fees), /*ancestors=*/0, /*cluster_count=*/0); |
| 73 | return group; |
| 74 | } |
| 75 | |
| 76 | /** Make multiple OutputGroups with the given values as their effective value */ |
| 77 | static void AddCoins(std::vector<OutputGroup>& utxo_pool, std::vector<CAmount> coins, CoinSelectionParams cs_params = default_cs_params) |
no test coverage detected