diff options
author | dec05eba <dec05eba@protonmail.com> | 2018-04-28 15:30:21 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-08-18 23:25:46 +0200 |
commit | 1e4dac83952e1f707cdb837f647e6c80c3414154 (patch) | |
tree | e71ca0cc8bce2b644e18e716f5fd8e998d5fdf83 /include/odhtdb/DatabaseStorage.hpp | |
parent | fb447b94e369114df0bc96b5c4c20b2cd102bff0 (diff) |
Add stop seeding function
Diffstat (limited to 'include/odhtdb/DatabaseStorage.hpp')
-rw-r--r-- | include/odhtdb/DatabaseStorage.hpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/odhtdb/DatabaseStorage.hpp b/include/odhtdb/DatabaseStorage.hpp index 85a61eb..9cfe12d 100644 --- a/include/odhtdb/DatabaseStorage.hpp +++ b/include/odhtdb/DatabaseStorage.hpp @@ -140,9 +140,15 @@ namespace odhtdb // Returns nullptr if no storage with provided hash exists const DatabaseStorageObjectList* getStorage(const Hash &hash) const; + // Returns nullptr if node @nodeHash doesn't exist + const DataViewMap<Group*>* getNodeGroups(const Hash &nodeHash); + // Returns nullptr if a group with id @groupId doesn't exist in node @nodeHash or if no node with id @nodeHash exists Group* getGroupById(const Hash &nodeHash, uint8_t groupId[GROUP_ID_LENGTH]) const; + // Returns nullptr if node @nodeHash doesn't exist + const Signature::MapPublicKey<User*>* getNodeUsers(const Hash &nodeHash); + // Returns nullptr if a user with public key @publicKey doesn't exist in node @nodeHash or if no node with id @nodeHash exists User* getUserByPublicKey(const Hash &nodeHash, const Signature::PublicKey &userPublicKey) const; @@ -159,6 +165,9 @@ namespace odhtdb // Safe to call multiple times. std::vector<NodeLocalUser> getLocalNodeUsers(const Signature::KeyPair &keyPair); + // Returns true and node decryption key if node exists and we have the decryption key, + // otherwise return false and OwnedMemory with data set to nullptr + std::pair<bool, std::shared_ptr<OwnedMemory>> getNodeDecryptionKey(const Hash &nodeHash); void setNodeDecryptionKey(const Hash &nodeHash, const DataView &decryptionKey); const dht::crypto::Identity& getIdentity() const; |