nertwork engine: move tid management to Node

This commit is contained in:
Adrien Béraud committed 2017-10-11 17:36:20 +02:00
1 parent 3bb5e7ee12
commit 98ec789526
5 files changed
+32 -22

No files matched your search

+10
View File
@@ -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