dht: support client mode

In client mode, a node won't store data
and won't participate in routing.
This commit is contained in:
Adrien Béraud committed 2017-10-12 15:44:14 +02:00
1 parent 4ce0168916
commit e20ae56cab
6 files changed
+28 -19

No files matched your search

+2 -3
View File
@@ -31,9 +31,8 @@ constexpr std::chrono::minutes Node::NODE_GOOD_TIME;
constexpr std::chrono::seconds Node::MAX_RESPONSE_TIME;
Node::Node(const InfoHash& id, const SockAddr& addr)
: id(id),
addr(addr)
Node::Node(const InfoHash& id, const SockAddr& addr, bool client)
: id(id), addr(addr), is_client(client)
{
crypto::random_device rd;
transaction_id = TransactionDist{1}(rd);