From d71fe129b83f34b46136070fcf9a64865203be14 Mon Sep 17 00:00:00 2001 From: dec05eba <0xdec05eba@gmail.com> Date: Wed, 25 Apr 2018 05:29:43 +0200 Subject: Store opendht identity in storage file (cached) --- include/odhtdb/Database.hpp | 3 --- include/odhtdb/DatabaseStorage.hpp | 4 ++++ include/odhtdb/env.hpp | 4 ---- 3 files changed, 4 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/odhtdb/Database.hpp b/include/odhtdb/Database.hpp index a8833fc..846ddaa 100644 --- a/include/odhtdb/Database.hpp +++ b/include/odhtdb/Database.hpp @@ -12,9 +12,6 @@ #include "DatabaseNode.hpp" #include "Encryption.hpp" #include "OwnedMemory.hpp" -#ifdef DEBUG -#undef DEBUG -#endif #include #include #include diff --git a/include/odhtdb/DatabaseStorage.hpp b/include/odhtdb/DatabaseStorage.hpp index a2789f7..a9e04ef 100644 --- a/include/odhtdb/DatabaseStorage.hpp +++ b/include/odhtdb/DatabaseStorage.hpp @@ -10,6 +10,7 @@ #include #include #include +#include namespace odhtdb { @@ -106,6 +107,8 @@ namespace odhtdb // Return users in node, or nullptr if no node with id @nodeHash exists const Signature::MapPublicKey* getUsersData(const Hash &nodeHash) const; + const dht::crypto::Identity& getIdentity() const; + // Update storage state (remove quarantine objects if they are too old, etc) void update(); private: @@ -126,5 +129,6 @@ namespace odhtdb boost::filesystem::path dataFilePath; boost::filesystem::path metadataFilePath; u8 passwordSalt[PASSWORD_SALT_LEN]; + std::pair, std::shared_ptr> identity; }; } diff --git a/include/odhtdb/env.hpp b/include/odhtdb/env.hpp index bafc750..abaedd8 100644 --- a/include/odhtdb/env.hpp +++ b/include/odhtdb/env.hpp @@ -57,7 +57,3 @@ #if !defined(OS_TYPE) #error "System not supported. Only Windows and linux systems supported right now" #endif - -#if !defined(DEBUG) && !defined(NDEBUG) -#define DEBUG -#endif -- cgit v1.2.3