mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
wallet: encapsulate pre-selected-inputs lookup into its own function
First step towards decoupling the pre-selected-inputs fetching functionality from `SelectCoins`. Which, will let us not waste resources calculating the available coins if one of the pre-set inputs has an error. (right now, if one of the pre-set inputs is invalid, we first walk through the entire wallet txes map just to end up failing right after it finish)
This commit is contained in:
@@ -444,6 +444,12 @@ void SelectionResult::AddInput(const OutputGroup& group)
|
||||
m_use_effective = !group.m_subtract_fee_outputs;
|
||||
}
|
||||
|
||||
void SelectionResult::AddInputs(const std::set<COutput>& inputs, bool subtract_fee_outputs)
|
||||
{
|
||||
util::insert(m_selected_inputs, inputs);
|
||||
m_use_effective = !subtract_fee_outputs;
|
||||
}
|
||||
|
||||
void SelectionResult::Merge(const SelectionResult& other)
|
||||
{
|
||||
m_target += other.m_target;
|
||||
|
||||
Reference in New Issue
Block a user