diff options
author | Andrew Chow <achow101-github@achow101.com> | 2020-11-16 16:39:22 -0500 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2021-12-05 13:40:48 -0500 |
commit | e8f7ae5eb3c682d1a80b503f71e06ce76af1b65c (patch) | |
tree | 25486e5677ea76e74acdb362e8fe35b43196d340 /src/wallet | |
parent | 51a9c00b4de707e0a6a1a68ca6f8e38d86c72d94 (diff) |
Make an OutputGroup for preset inputs
In SelectCoins, for our preset inputs, we combine all of the preset
inputs into a single OutputGroup. This allows us to combine the preset
inputs with additional selection algo results.
Diffstat (limited to 'src/wallet')
-rw-r--r-- | src/wallet/spend.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/wallet/spend.cpp b/src/wallet/spend.cpp index ef8885e738..d975e5a95b 100644 --- a/src/wallet/spend.cpp +++ b/src/wallet/spend.cpp @@ -443,6 +443,7 @@ bool SelectCoins(const CWallet& wallet, const std::vector<COutput>& vAvailableCo // calculate value from preset inputs and store them std::set<CInputCoin> setPresetCoins; CAmount nValueFromPresetInputs = 0; + OutputGroup preset_inputs(coin_selection_params); std::vector<COutPoint> vPresetInputs; coin_control.ListSelected(vPresetInputs); @@ -480,6 +481,10 @@ bool SelectCoins(const CWallet& wallet, const std::vector<COutput>& vAvailableCo value_to_select -= coin.effective_value; } setPresetCoins.insert(coin); + /* Set depth, from_me, ancestors, and descendants to 0 or false as don't matter for preset inputs as no actual selection is being done. + * positive_only is set to false because we want to include all preset inputs, even if they are dust. + */ + preset_inputs.Insert(coin, 0, false, 0, 0, false); } // remove preset inputs from vCoins so that Coin Selection doesn't pick them. |