From 1036ce0fa592fa6dc661251adc46116a26887585 Mon Sep 17 00:00:00 2001 From: orignal Date: Sat, 19 Mar 2016 08:07:09 -0400 Subject: [PATCH] create addressbook before etags --- AddressBook.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/AddressBook.cpp b/AddressBook.cpp index 2a6fbaf0..22008294 100644 --- a/AddressBook.cpp +++ b/AddressBook.cpp @@ -49,15 +49,19 @@ namespace client bool AddressBookFilesystemStorage::Init() { storage.SetPlace(i2p::fs::GetDataDir()); - // init ETags - etagsPath = i2p::fs::StorageRootPath (storage, "etags"); - if (!i2p::fs::Exists (etagsPath)) - i2p::fs::CreateDirectory (etagsPath); - // init address files - indexPath = i2p::fs::StorageRootPath (storage, "addresses.csv"); - localPath = i2p::fs::StorageRootPath (storage, "local.csv"); // init storage - return storage.Init(i2p::data::GetBase32SubstitutionTable(), 32); + if (storage.Init(i2p::data::GetBase32SubstitutionTable(), 32)) + { + // init ETags + etagsPath = i2p::fs::StorageRootPath (storage, "etags"); + if (!i2p::fs::Exists (etagsPath)) + i2p::fs::CreateDirectory (etagsPath); + // init address files + indexPath = i2p::fs::StorageRootPath (storage, "addresses.csv"); + localPath = i2p::fs::StorageRootPath (storage, "local.csv"); + return true; + } + return false; } std::shared_ptr AddressBookFilesystemStorage::GetAddress (const i2p::data::IdentHash& ident) const