diff options
author | dec05eba <dec05eba@protonmail.com> | 2018-10-16 00:38:01 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-08-18 23:25:46 +0200 |
commit | 0e627b69d4d0a8d01a21e4dc9bd7be370c0a1245 (patch) | |
tree | b4385cb95cf6b4315000c149ac115c15fec10bba /include/odhtdb/DatabaseStorage.hpp | |
parent | 060b6db1aadccd1ad3495c52a15b4a789e4bc8da (diff) |
Replace opendht with sibs pubsub
This should fix issues with memory usage/leaks and make it easier
to get peers subscribed to the same key.
It will also be easier to modify and also works easier cross platform
because of no additional dependencies.
Diffstat (limited to 'include/odhtdb/DatabaseStorage.hpp')
-rw-r--r-- | include/odhtdb/DatabaseStorage.hpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/include/odhtdb/DatabaseStorage.hpp b/include/odhtdb/DatabaseStorage.hpp index b84635c..b0c081e 100644 --- a/include/odhtdb/DatabaseStorage.hpp +++ b/include/odhtdb/DatabaseStorage.hpp @@ -17,9 +17,8 @@ #include <stdexcept> #include <boost/filesystem/path.hpp> #include <sibs/SafeDeserializer.hpp> -#include <opendht/crypto.h> -#include <opendht/dhtrunner.h> #include <functional> +#include <sibs/DirectConnection.hpp> class sqlite3; class sqlite3_stmt; @@ -141,13 +140,11 @@ namespace odhtdb std::pair<bool, std::shared_ptr<OwnedByteArray>> getNodeDecryptionKey(const Hash &nodeHash); void setNodeDecryptionKey(const Hash &nodeHash, const DataView &decryptionKey); - const std::vector<dht::NodeExport>& getRemoteNodes() const; - void setRemoteNodes(const std::vector<dht::NodeExport> &remoteNodes); + const std::vector<std::shared_ptr<sibs::DirectConnectionPeer>>& getRemotePeers() const; + void setRemotePeers(const std::vector<std::shared_ptr<sibs::DirectConnectionPeer>> &remoteNodes); std::vector<OwnedByteArray> getUserGroups(const Hash &nodeHash, const Signature::PublicKey &userPublicKey) const; - const dht::crypto::Identity& getIdentity() const; - // Update storage state (remove quarantine objects if they are too old, etc) void update(); @@ -203,7 +200,6 @@ namespace odhtdb boost::filesystem::path remoteNodesFilePath; u8 passwordSalt[PASSWORD_SALT_LEN]; - std::pair<std::shared_ptr<dht::crypto::PrivateKey>, std::shared_ptr<dht::crypto::Certificate>> identity; - std::vector<dht::NodeExport> remoteNodes; + std::vector<std::shared_ptr<sibs::DirectConnectionPeer>> remotePeers; }; } |