aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/coinselection.cpp
diff options
context:
space:
mode:
authorS3RK <1466284+S3RK@users.noreply.github.com>2022-07-06 09:18:17 +0200
committerS3RK <1466284+S3RK@users.noreply.github.com>2022-08-15 09:34:38 +0200
commitf8e796348b644c011ad9a8312356d4426c16cc4b (patch)
tree290d1c594b6a5fe25576bc5426af6f38c4450dad /src/wallet/coinselection.cpp
parent06f558e4e2164d1916f258c731efe4586728a23b (diff)
downloadbitcoin-f8e796348b644c011ad9a8312356d4426c16cc4b.tar.xz
wallet: add SelectionResult::Merge
Diffstat (limited to 'src/wallet/coinselection.cpp')
-rw-r--r--src/wallet/coinselection.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/wallet/coinselection.cpp b/src/wallet/coinselection.cpp
index 0f2e57f9a1..a61921f69f 100644
--- a/src/wallet/coinselection.cpp
+++ b/src/wallet/coinselection.cpp
@@ -433,6 +433,16 @@ void SelectionResult::AddInput(const OutputGroup& group)
m_use_effective = !group.m_subtract_fee_outputs;
}
+void SelectionResult::Merge(const SelectionResult& other)
+{
+ m_target += other.m_target;
+ m_use_effective |= other.m_use_effective;
+ if (m_algo == SelectionAlgorithm::MANUAL) {
+ m_algo = other.m_algo;
+ }
+ util::insert(m_selected_inputs, other.m_selected_inputs);
+}
+
const std::set<COutput>& SelectionResult::GetInputSet() const
{
return m_selected_inputs;