Bitcoin ABC
0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
src
avalanche
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
15
using
PeerId
=
uint32_t
;
16
static
constexpr
PeerId
NO_PEER
= -1;
17
18
namespace
avalanche
{
19
20
struct
Node
{
21
NodeId
nodeid
;
22
PeerId
peerid
;
23
SteadyMilliseconds
nextRequestTime
;
24
bool
avaproofsSent
;
25
26
Node
(
NodeId
nodeid_
,
PeerId
peerid_
)
27
:
nodeid
(
nodeid_
),
peerid
(
peerid_
),
28
nextRequestTime
(
Now
<
SteadyMilliseconds
>()),
avaproofsSent
(
false
) {}
29
};
30
31
}
// namespace avalanche
32
33
#endif
// BITCOIN_AVALANCHE_NODE_H
NO_PEER
static constexpr PeerId NO_PEER
Definition
node.h:16
PeerId
uint32_t PeerId
Definition
node.h:15
avalanche
Definition
avalanche.h:13
nodeid.h
NodeId
int64_t NodeId
Definition
nodeid.h:10
pubkey.h
GetRand
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
Definition
random.h:85
avalanche::Node
Definition
node.h:20
avalanche::Node::peerid
PeerId peerid
Definition
node.h:22
avalanche::Node::nextRequestTime
SteadyMilliseconds nextRequestTime
Definition
node.h:23
avalanche::Node::nodeid
NodeId nodeid
Definition
node.h:21
avalanche::Node::avaproofsSent
bool avaproofsSent
Definition
node.h:24
avalanche::Node::Node
Node(NodeId nodeid_, PeerId peerid_)
Definition
node.h:26
time.h
Now
constexpr T Now()
Return the current time point cast to the given precision.
Definition
time.h:109
SteadyMilliseconds
std::chrono::time_point< std::chrono::steady_clock, std::chrono::milliseconds > SteadyMilliseconds
Definition
time.h:31
Generated on Thu Dec 26 2024 02:38:01 for Bitcoin ABC by
1.9.8