diff options
author | Aleksi Lindeman <0xdec05eba@gmail.com> | 2018-03-13 03:03:11 +0100 |
---|---|---|
committer | Aleksi Lindeman <0xdec05eba@gmail.com> | 2018-03-13 03:06:45 +0100 |
commit | f84aba861d26601ae4c7203daa39752e7c95cfd8 (patch) | |
tree | 2b39728d07fb370e87b05ba2fb63958e5ad8fb28 /include/Database.hpp | |
parent | 1328d943c5016dd1662a4e46d4a408bca010cffc (diff) |
Fix add data operation not working correctly
Reminder: do not get reference to hash map value... duh
Add thread-safe logging (log is in order now!).
Store data immediately to database when WE add it instead of waiting for
response from remote peers.
TODO: Test with multiple peers (not only localhost)
Diffstat (limited to 'include/Database.hpp')
-rw-r--r-- | include/Database.hpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/Database.hpp b/include/Database.hpp index 64a381c..6bc7bc5 100644 --- a/include/Database.hpp +++ b/include/Database.hpp @@ -141,9 +141,9 @@ namespace odhtdb void commitStagedAddObject(const std::unique_ptr<StagedObject> &stagedObject); ntp::NtpTimestamp getSyncedTimestampUtc() const; DatabaseCreateRequest deserializeCreateRequest(const std::shared_ptr<dht::Value> &value, const Hash &hash, const std::shared_ptr<char*> encryptionKey); - void deserializeAddRequest(const std::shared_ptr<dht::Value> &value, const Hash &hash, const std::shared_ptr<char*> encryptionKey); + void deserializeAddRequest(const std::shared_ptr<dht::Value> &value, const Hash &requestDataHash, const std::shared_ptr<char*> encryptionKey); bool listenCreateData(std::shared_ptr<dht::Value> value, const Hash &hash, const std::shared_ptr<char*> encryptionKey); - bool listenAddData(std::shared_ptr<dht::Value> value, const Hash &hash, const std::shared_ptr<char*> encryptionKey); + bool listenAddData(std::shared_ptr<dht::Value> value, const Hash &requestDataHash, const std::shared_ptr<char*> encryptionKey); private: dht::DhtRunner node; std::vector<std::unique_ptr<StagedObject>> stagedCreateObjects; |