Return SelectionResult from KnapsackSolver

Returns a std::optional<SelectionResult> from KnapsackSolver instead of
using out parameters for the inputs set and selected value.
This commit is contained in:
Andrew Chow
2020-11-16 15:36:47 -05:00
parent 60d2ca72e3
commit 0ef6184575
4 changed files with 134 additions and 114 deletions

View File

@@ -246,6 +246,6 @@ std::optional<SelectionResult> SelectCoinsBnB(std::vector<OutputGroup>& utxo_poo
std::optional<std::pair<std::set<CInputCoin>, CAmount>> SelectCoinsSRD(const std::vector<OutputGroup>& utxo_pool, CAmount target_value);
// Original coin selection algorithm as a fallback
bool KnapsackSolver(const CAmount& nTargetValue, std::vector<OutputGroup>& groups, std::set<CInputCoin>& setCoinsRet, CAmount& nValueRet);
std::optional<SelectionResult> KnapsackSolver(std::vector<OutputGroup>& groups, const CAmount& nTargetValue);
#endif // BITCOIN_WALLET_COINSELECTION_H