aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-05-16 21:51:29 +0200
committerdec05eba <dec05eba@protonmail.com>2020-08-18 23:25:46 +0200
commit90f13e93f4f7d830a77be65998978559f8cc5419 (patch)
treec10d5915bfb5b28744d21c614e9360752ef75f0c /src
parent43507b8bef2de14ad8c02fa421d9ced134d768e2 (diff)
Add debug output
Diffstat (limited to 'src')
-rw-r--r--src/Database.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Database.cpp b/src/Database.cpp
index da89f2f..0fdc438 100644
--- a/src/Database.cpp
+++ b/src/Database.cpp
@@ -261,13 +261,19 @@ namespace odhtdb
InfoHash requestResponseInfoHash;
deserializer.extract(requestResponseInfoHash.data(), OPENDHT_INFOHASH_LEN);
if(*responseKeyShared == requestResponseInfoHash)
- return true; // We sent the request, ignore our own requests
+ {
+ Log::debug("Request: Ignorning request for old data from ourself");
+ return true;
+ }
+ else
+ Log::debug("Request: Got request from somebody else");
bool userWantsCreateNode = deserializer.extract<u8>() == 1;
DatabaseFetchOrder fetchOrder = deserializer.extract<DatabaseFetchOrder>();
if(userWantsCreateNode)
{
+ Log::debug("Request: Peer wants CreateNode");
databaseStorage.fetchNodeRaw(*nodeToSeed.getRequestHash(), [this, requestResponseInfoHash](const DataView rawData)
{
Log::debug("Request: Sent create packet to requesting peer");
@@ -364,6 +370,7 @@ namespace odhtdb
serializer.add(~(u64)0ULL - userLatestActionCounterData.second);
}
+ Log::debug("Sending request for old data");
Value requestValue(move(serializer.getBuffer()));
node.put(dhtKey.getRequestOldDataKey(), move(requestValue), [](bool ok)
{