Bitcoin ABC 0.33.3
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#include <util/time.h>
11
12#include <chrono>
13#include <cstdint>
14
15using PeerId = uint32_t;
16static constexpr PeerId NO_PEER = -1;
17
18namespace avalanche {
19
20struct Node {
24 bool avaproofsSent{false};
25 uint64_t last_round{0};
27
28 Node(NodeId nodeid_, PeerId peerid_, size_t maxElements_)
29 : nodeid(nodeid_), peerid(peerid_),
31 maxElements(maxElements_) {}
32};
33
34} // namespace avalanche
35
36#endif // BITCOIN_AVALANCHE_NODE_H
static constexpr PeerId NO_PEER
Definition: node.h:16
uint32_t PeerId
Definition: node.h:15
int64_t NodeId
Definition: eviction.h:16
size_t maxElements
Definition: node.h:26
uint64_t last_round
Definition: node.h:25
Node(NodeId nodeid_, PeerId peerid_, size_t maxElements_)
Definition: node.h:28
PeerId peerid
Definition: node.h:22
SteadyMilliseconds nextRequestTime
Definition: node.h:23
NodeId nodeid
Definition: node.h:21
bool avaproofsSent
Definition: node.h:24
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