Bitcoin ABC 0.33.5
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 <util/time.h>
10
11#include <chrono>
12#include <cstdint>
13
14using PeerId = uint32_t;
15static constexpr PeerId NO_PEER = -1;
16
17namespace avalanche {
18
19struct Node {
23 bool avaproofsSent{false};
24 uint64_t last_round{0};
26
27 Node(NodeId nodeid_, PeerId peerid_, size_t maxElements_)
28 : nodeid(nodeid_), peerid(peerid_),
30 maxElements(maxElements_) {}
31};
32
33} // namespace avalanche
34
35#endif // BITCOIN_AVALANCHE_NODE_H
static constexpr PeerId NO_PEER
Definition: node.h:15
uint32_t PeerId
Definition: node.h:14
int64_t NodeId
Definition: eviction.h:16
size_t maxElements
Definition: node.h:25
uint64_t last_round
Definition: node.h:24
Node(NodeId nodeid_, PeerId peerid_, size_t maxElements_)
Definition: node.h:27
PeerId peerid
Definition: node.h:21
SteadyMilliseconds nextRequestTime
Definition: node.h:22
NodeId nodeid
Definition: node.h:20
bool avaproofsSent
Definition: node.h:23
constexpr T Now()
Return the current time point cast to the given precision.
Definition: time.h:139
std::chrono::time_point< std::chrono::steady_clock, std::chrono::milliseconds > SteadyMilliseconds
Definition: time.h:33