fix bug on ==

This commit is contained in:
ghe0 2024-12-22 21:00:41 +02:00
parent b45f970e40
commit 7905c1c165
Signed by: ghe0
GPG Key ID: 451028EE56A0FBB4

@ -180,7 +180,7 @@ impl BrainData {
e
);
}
if confirmation.error == "" {
if confirmation.error != "" {
return;
}
let contract = Contract {
@ -274,12 +274,17 @@ impl BrainData {
}
pub fn find_contracts_by_admin_pubkey(&self, admin_pubkey: &str) -> Vec<Contract> {
let contracts = self.contracts.read().unwrap();
contracts
debug!("Searching contracts for admin pubkey {admin_pubkey}");
let contracts: Vec<Contract> = self
.contracts
.read()
.unwrap()
.iter()
.cloned()
.filter(|c| c.admin_pubkey == admin_pubkey)
.collect()
.collect();
debug!("Found {} contracts or {admin_pubkey}.", contracts.len());
contracts
}
pub fn find_contracts_by_node_pubkey(&self, node_pubkey: &str) -> Vec<Contract> {