wallet: add SelectionResult::Merge

This commit is contained in:
S3RK
2022-07-06 09:18:17 +02:00
parent 06f558e4e2
commit f8e796348b
3 changed files with 22 additions and 7 deletions

View File

@@ -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;