mirror of
https://github.com/savoirfairelinux/opendht.git
synced 2026-11-08 04:21:51 +00:00
nertwork engine: move tid management to Node
This commit is contained in:
1 parent
3bb5e7ee12
commit
98ec789526
5 files changed
+32
-22
No files matched your search
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "node.h"
|
||||
#include "request.h"
|
||||
#include "rng.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
@@ -29,6 +30,15 @@ constexpr std::chrono::minutes Node::NODE_EXPIRE_TIME;
|
||||
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)
|
||||
{
|
||||
crypto::random_device rd;
|
||||
transaction_id = TransactionDist{1}(rd);
|
||||
}
|
||||
|
||||
/* This is our definition of a known-good node. */
|
||||
bool
|
||||
Node::isGood(time_point now) const
|
||||
|
||||
Reference in new issue
Block a user