@@ -281,17 +281,16 @@ struct SelectionResult
281
281
private:
282
282
/* * Set of inputs selected by the algorithm to use in the transaction */
283
283
std::set<COutput> m_selected_inputs;
284
+ /* * The target the algorithm selected for. Equal to the recipient amount plus non-input fees */
285
+ CAmount m_target;
286
+ /* * The algorithm used to produce this result */
287
+ SelectionAlgorithm m_algo;
284
288
/* * Whether the input values for calculations should be the effective value (true) or normal value (false) */
285
289
bool m_use_effective{false };
286
290
/* * The computed waste */
287
291
std::optional<CAmount> m_waste;
288
292
289
293
public:
290
- /* * The target the algorithm selected for. Note that this may not be equal to the recipient amount as it can include non-input fees */
291
- const CAmount m_target;
292
- /* * The algorithm used to produce this result */
293
- const SelectionAlgorithm m_algo;
294
-
295
294
explicit SelectionResult (const CAmount target, SelectionAlgorithm algo)
296
295
: m_target(target), m_algo(algo) {}
297
296
@@ -308,12 +307,18 @@ struct SelectionResult
308
307
void ComputeAndSetWaste (CAmount change_cost);
309
308
[[nodiscard]] CAmount GetWaste () const ;
310
309
310
+ void Merge (const SelectionResult& other);
311
+
311
312
/* * Get m_selected_inputs */
312
313
const std::set<COutput>& GetInputSet () const ;
313
314
/* * Get the vector of COutputs that will be used to fill in a CTransaction's vin */
314
315
std::vector<COutput> GetShuffledInputVector () const ;
315
316
316
317
bool operator <(SelectionResult other) const ;
318
+
319
+ CAmount GetTarget () const { return m_target; }
320
+
321
+ SelectionAlgorithm GetAlgo () const { return m_algo; }
317
322
};
318
323
319
324
std::optional<SelectionResult> SelectCoinsBnB (std::vector<OutputGroup>& utxo_pool, const CAmount& selection_target, const CAmount& cost_of_change);
0 commit comments