From 2f7fd4d476e73375bbf7fe49d5a9aa3fb1e792ca Mon Sep 17 00:00:00 2001 From: dec05eba <0xdec05eba@gmail.com> Date: Wed, 16 May 2018 21:51:29 +0200 Subject: Add debug output --- src/Database.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/Database.cpp') 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() == 1; DatabaseFetchOrder fetchOrder = deserializer.extract(); 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) { -- cgit v1.2.3