Bitcoin ABC  0.24.7
P2P Digital Currency
node.h
Go to the documentation of this file.
1 // Copyright (c) 2018-2019 The Bitcoin developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef BITCOIN_AVALANCHE_NODE_H
6 #define BITCOIN_AVALANCHE_NODE_H
7 
8 #include <nodeid.h>
9 #include <pubkey.h>
10 
11 #include <chrono>
12 #include <cstdint>
13 
14 using PeerId = uint32_t;
15 static constexpr PeerId NO_PEER = -1;
16 
17 using TimePoint = std::chrono::time_point<std::chrono::steady_clock>;
18 
19 namespace avalanche {
20 
21 struct Node {
25 
26  Node(NodeId nodeid_, PeerId peerid_)
27  : nodeid(nodeid_), peerid(peerid_),
28  nextRequestTime(std::chrono::steady_clock::now()) {}
29 };
30 
31 } // namespace avalanche
32 
33 #endif // BITCOIN_AVALANCHE_NODE_H
avalanche
Definition: avalanche.h:11
pubkey.h
avalanche::Node::nodeid
NodeId nodeid
Definition: node.h:22
avalanche::Node::peerid
PeerId peerid
Definition: node.h:23
TimePoint
std::chrono::time_point< std::chrono::steady_clock > TimePoint
Definition: node.h:17
avalanche::Node::nextRequestTime
TimePoint nextRequestTime
Definition: node.h:24
avalanche::Node
Definition: node.h:21
nodeid.h
NodeId
int64_t NodeId
Definition: nodeid.h:10
avalanche::Node::Node
Node(NodeId nodeid_, PeerId peerid_)
Definition: node.h:26
NO_PEER
static constexpr PeerId NO_PEER
Definition: node.h:15
PeerId
uint32_t PeerId
Definition: node.h:14