From f8e796348b644c011ad9a8312356d4426c16cc4b Mon Sep 17 00:00:00 2001 From: S3RK <1466284+S3RK@users.noreply.github.com> Date: Wed, 6 Jul 2022 09:18:17 +0200 Subject: wallet: add SelectionResult::Merge --- src/wallet/coinselection.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/wallet/coinselection.cpp') 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& SelectionResult::GetInputSet() const { return m_selected_inputs; -- cgit v1.2.3