mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-23 17:08:10 -07:00
parser: databases: small changes
This commit is contained in:
@@ -80,7 +80,9 @@ impl AddressIndexToAddressData {
|
||||
(db_index + 1) * ADDRESS_INDEX_DB_MAX_SIZE
|
||||
);
|
||||
|
||||
Database::open(Self::folder(), &db_name).unwrap()
|
||||
let path = Self::root().join(db_name);
|
||||
|
||||
Database::open(path).unwrap()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -113,12 +115,16 @@ impl AddressIndexToAddressData {
|
||||
impl AnyDatabaseGroup for AddressIndexToAddressData {
|
||||
fn import() -> Self {
|
||||
Self {
|
||||
metadata: Metadata::import(&Self::full_path(), 1),
|
||||
metadata: Metadata::import(Self::root(), 1),
|
||||
|
||||
map: BTreeMap::default(),
|
||||
}
|
||||
}
|
||||
|
||||
fn create_dir_all(&self) -> color_eyre::Result<(), std::io::Error> {
|
||||
fs::create_dir_all(Self::root())
|
||||
}
|
||||
|
||||
fn reset_metadata(&mut self) {
|
||||
self.metadata.reset();
|
||||
}
|
||||
@@ -128,7 +134,7 @@ impl AnyDatabaseGroup for AddressIndexToAddressData {
|
||||
}
|
||||
|
||||
fn open_all(&mut self) {
|
||||
let path = Self::full_path();
|
||||
let path = Self::root();
|
||||
|
||||
let folder = fs::read_dir(path);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user