wallet: add try_decrypt_all

This commit is contained in:
Jon Häggblad
2022-04-06 17:01:05 +02:00
parent 1657dd5b57
commit ec355dd236
@@ -99,6 +99,14 @@ impl StoredWallet {
pub fn password_can_decrypt_all(&self, password: &UserPassword) -> bool {
self.decrypt_all(password).is_ok()
}
pub fn try_decrypt_all(&self, password: &UserPassword) -> Vec<StoredAccount> {
self
.accounts
.iter()
.filter_map(|account| account.account.decrypt_struct(password).ok())
.collect()
}
}
impl Default for StoredWallet {