aboutsummaryrefslogtreecommitdiff
path: root/src/DhtKey.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-05-16 07:25:22 +0200
committerdec05eba <dec05eba@protonmail.com>2020-08-18 23:25:46 +0200
commit92d6393a34dac4b3d623a5169e2b50a9518b4976 (patch)
treea318cc84e3837f61c03cd4a0533c3380bb5fdbde /src/DhtKey.cpp
parentc0574f16ca7960a3301230ba36ba96148818e229 (diff)
Add functions to send/receive custom messages
Diffstat (limited to 'src/DhtKey.cpp')
-rw-r--r--src/DhtKey.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/DhtKey.cpp b/src/DhtKey.cpp
index 7bd6acf..422b715 100644
--- a/src/DhtKey.cpp
+++ b/src/DhtKey.cpp
@@ -8,13 +8,18 @@ namespace odhtdb
firstByteOriginalValue = infoHash[0];
}
- const dht::InfoHash& DhtKey::getNewDataListenerKey()
+ DhtKey::DhtKey(const dht::InfoHash &_infoHash) : infoHash(_infoHash)
+ {
+ firstByteOriginalValue = infoHash[0];
+ }
+
+ dht::InfoHash DhtKey::getNewDataListenerKey()
{
infoHash[0] = firstByteOriginalValue;
return infoHash;
}
- const dht::InfoHash& DhtKey::getRequestOldDataKey()
+ dht::InfoHash DhtKey::getRequestOldDataKey()
{
infoHash[0] = firstByteOriginalValue + 1;
return infoHash;