diff --git a/accounts-db/src/accounts_file.rs b/accounts-db/src/accounts_file.rs index 117148ad050227..6371be6083cc84 100644 --- a/accounts-db/src/accounts_file.rs +++ b/accounts-db/src/accounts_file.rs @@ -67,21 +67,8 @@ impl AccountsFile { /// The second element of the returned tuple is the number of accounts in the /// accounts file. pub fn new_from_file(path: impl AsRef, current_len: usize) -> Result<(Self, usize)> { - match TieredStorage::new_readonly(path.as_ref()) { - Ok(tiered_storage) => { - // unwrap() note: TieredStorage::new_readonly() is guaranteed to have a valid - // reader instance when opening with new_readonly. - let num_accounts = tiered_storage.reader().unwrap().num_accounts(); - Ok((Self::TieredStorage(tiered_storage), num_accounts)) - } - Err(TieredStorageError::MagicNumberMismatch(_, _)) => { - // In case of MagicNumberMismatch, we can assume that this is not - // a tiered-storage file. - let (av, num_accounts) = AppendVec::new_from_file(path, current_len)?; - Ok((Self::AppendVec(av), num_accounts)) - } - Err(e) => Err(AccountsFileError::TieredStorageError(e)), - } + let (av, num_accounts) = AppendVec::new_from_file(path, current_len)?; + Ok((Self::AppendVec(av), num_accounts)) } pub fn flush(&self) -> Result<()> {