From c7740f0e3cbcd9a7233258f22e6168b1cd8853a8 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 13 Mar 2018 03:03:11 +0100 Subject: 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) --- include/Database.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/Database.hpp') 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); ntp::NtpTimestamp getSyncedTimestampUtc() const; DatabaseCreateRequest deserializeCreateRequest(const std::shared_ptr &value, const Hash &hash, const std::shared_ptr encryptionKey); - void deserializeAddRequest(const std::shared_ptr &value, const Hash &hash, const std::shared_ptr encryptionKey); + void deserializeAddRequest(const std::shared_ptr &value, const Hash &requestDataHash, const std::shared_ptr encryptionKey); bool listenCreateData(std::shared_ptr value, const Hash &hash, const std::shared_ptr encryptionKey); - bool listenAddData(std::shared_ptr value, const Hash &hash, const std::shared_ptr encryptionKey); + bool listenAddData(std::shared_ptr value, const Hash &requestDataHash, const std::shared_ptr encryptionKey); private: dht::DhtRunner node; std::vector> stagedCreateObjects; -- cgit v1.2.3