From c8f015c546d095857fde0f5fbef95156ce993691 Mon Sep 17 00:00:00 2001 From: dec05eba <0xdec05eba@gmail.com> Date: Wed, 16 May 2018 22:58:04 +0200 Subject: Fix node raw data bug (data type mismatch), add debug statements --- src/Database.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/Database.cpp') diff --git a/src/Database.cpp b/src/Database.cpp index 0fdc438..065f441 100644 --- a/src/Database.cpp +++ b/src/Database.cpp @@ -101,7 +101,7 @@ namespace odhtdb /*.node_config = */{ /*.node_id = */{}, /*.network = */0, - /*.is_bootstrap = */true, + /*.is_bootstrap = */false, /*.maintain_storage*/false }, /*.id = */databaseStorage.getIdentity() @@ -554,10 +554,7 @@ namespace odhtdb uint8_t adminGroupId[GROUP_ID_LENGTH]; deserializer.extract(adminGroupId, GROUP_ID_LENGTH); - - if(deserializer.getSize() < ENCRYPTION_NONCE_BYTE_SIZE) - throw sibs::DeserializeException("Unsigned encrypted body is too small (unable to extract nonce)"); - + databaseStorage.createStorage(hash, userPublicKey, DataView(adminGroupId, GROUP_ID_LENGTH), creationDate, value->data.data(), value->data.size()); } @@ -605,7 +602,7 @@ namespace odhtdb bool Database::listenCreateData(shared_ptr value, const Hash &hash, const shared_ptr encryptionKey) { - Log::debug("Got create data"); + Log::debug("Got create data in node %s", hash.toString().c_str()); try { // This check is here to reduce processing, it doesn't matter much if the packet bypasses this, @@ -623,7 +620,7 @@ namespace odhtdb bool Database::listenAddData(shared_ptr value, const Hash &requestDataHash, const std::shared_ptr nodeHash, const shared_ptr encryptionKey) { - Log::debug("Got add data"); + Log::debug("Got add data in node %s", nodeHash->toString().c_str()); try { // This check is here to reduce processing, it doesn't matter much if the packet bypasses this, -- cgit v1.2.3