aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/coinselection.cpp
diff options
context:
space:
mode:
authorfurszy <matiasfurszyfer@protonmail.com>2022-07-31 17:22:04 -0300
committerfurszy <matiasfurszyfer@protonmail.com>2023-03-03 18:18:03 -0300
commit06ec8f992890cac69cd0fd20224aa51fa311a181 (patch)
treeb4d34d716b93574150ac7bfcff1051718f5b87cc /src/wallet/coinselection.cpp
parent3b88c8502534f0dc94e0abcb04ffa80ba8bd7f01 (diff)
downloadbitcoin-06ec8f992890cac69cd0fd20224aa51fa311a181.tar.xz
wallet: make OutputGroup "positive_only" filter explicit
And not hide it inside the `OutputGroup::Insert` method. This method does not return anything if insertion fails. We can know before calling `Insert` whether the coin will be accepted or not.
Diffstat (limited to 'src/wallet/coinselection.cpp')
-rw-r--r--src/wallet/coinselection.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/wallet/coinselection.cpp b/src/wallet/coinselection.cpp
index e6ba89627c..cebe2cd7ed 100644
--- a/src/wallet/coinselection.cpp
+++ b/src/wallet/coinselection.cpp
@@ -333,10 +333,7 @@ std::optional<SelectionResult> KnapsackSolver(std::vector<OutputGroup>& groups,
******************************************************************************/
-void OutputGroup::Insert(const COutput& output, size_t ancestors, size_t descendants, bool positive_only) {
- // Filter for positive only here before adding the coin
- if (positive_only && output.GetEffectiveValue() <= 0) return;
-
+void OutputGroup::Insert(const COutput& output, size_t ancestors, size_t descendants) {
m_outputs.push_back(output);
COutput& coin = m_outputs.back();