Skip to content

Commit

Permalink
Fix selection
Browse files Browse the repository at this point in the history
  • Loading branch information
gostkin committed Mar 21, 2023
1 parent f32d51a commit 002b4a2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions utxo-selection/src/algorithms/thermostat.rs
Expand Up @@ -5,10 +5,10 @@ use crate::{
use anyhow::{anyhow, Context};
use cardano_utils::multisig_plan::MultisigPlan;
use cardano_utils::network_id::NetworkInfo;
use dcspark_core::tx::{TransactionAsset, UTxODetails};
use dcspark_core::tx::{TransactionAsset, UTxODetails, UtxoPointer};
use dcspark_core::{Address, Balance, Regulated, TokenId, UTxOStore, Value};
use std::collections::hash_map::Entry;
use std::collections::HashMap;
use std::collections::{HashMap, HashSet};

pub struct ThermostatAlgoConfig {
num_accumulators: usize,
Expand Down Expand Up @@ -710,7 +710,8 @@ impl InputSelectionAlgorithm for Thermostat {
}

fn available_inputs(&self) -> Vec<Self::InputUtxo> {
todo!()
let selected_pointers: HashSet<UtxoPointer> = HashSet::from_iter(self.selected_inputs.iter().map(|input| input.pointer.clone()));
self.available_utxos.iter().map(|(_, utxo)| utxo.as_ref().clone()).filter(|utxo| !selected_pointers.contains(&utxo.pointer)).collect()
}
}

Expand Down

0 comments on commit 002b4a2

Please sign in to comment.