@@ -281,17 +281,16 @@ struct SelectionResult
281281private:
282282 /* * Set of inputs selected by the algorithm to use in the transaction */
283283 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;
284288 /* * Whether the input values for calculations should be the effective value (true) or normal value (false) */
285289 bool m_use_effective{false };
286290 /* * The computed waste */
287291 std::optional<CAmount> m_waste;
288292
289293public:
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-
295294 explicit SelectionResult (const CAmount target, SelectionAlgorithm algo)
296295 : m_target(target), m_algo(algo) {}
297296
@@ -308,12 +307,18 @@ struct SelectionResult
308307 void ComputeAndSetWaste (CAmount change_cost);
309308 [[nodiscard]] CAmount GetWaste () const ;
310309
310+ void Merge (const SelectionResult& other);
311+
311312 /* * Get m_selected_inputs */
312313 const std::set<COutput>& GetInputSet () const ;
313314 /* * Get the vector of COutputs that will be used to fill in a CTransaction's vin */
314315 std::vector<COutput> GetShuffledInputVector () const ;
315316
316317 bool operator <(SelectionResult other) const ;
318+
319+ CAmount GetTarget () const { return m_target; }
320+
321+ SelectionAlgorithm GetAlgo () const { return m_algo; }
317322};
318323
319324std::optional<SelectionResult> SelectCoinsBnB (std::vector<OutputGroup>& utxo_pool, const CAmount& selection_target, const CAmount& cost_of_change);
0 commit comments