Bitcoin ABC  0.25.8
P2P Digital Currency
avalanche.h
Go to the documentation of this file.
1 // Copyright (c) 2021 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_AVALANCHE_H
6 #define BITCOIN_AVALANCHE_AVALANCHE_H
7 
8 #include <cstddef>
9 #include <memory>
10 
11 #include <amount.h>
12 
13 namespace avalanche {
14 class Processor;
15 }
16 
17 class ArgsManager;
18 
22 static constexpr bool AVALANCHE_DEFAULT_ENABLED = false;
23 
27 static constexpr bool AVALANCHE_DEFAULT_PEER_DISCOVERY_ENABLED = false;
28 
33 static constexpr size_t AVALANCHE_DEFAULT_CONFLICTING_PROOF_COOLDOWN = 60;
34 
39 static constexpr size_t AVALANCHE_DEFAULT_PEER_REPLACEMENT_COOLDOWN = 60 * 60;
40 
44 static constexpr bool AVALANCHE_DEFAULT_PROOF_REPLACEMENT_ENABLED = false;
45 
49 static constexpr size_t AVALANCHE_DEFAULT_COOLDOWN = 100;
50 
59  Amount::zero();
60 
69 
77 static constexpr double AVALANCHE_DEFAULT_MIN_AVAPROOFS_NODE_COUNT = 0;
78 
82 extern std::unique_ptr<avalanche::Processor> g_avalanche;
83 
84 bool isAvalancheEnabled(const ArgsManager &argsman);
85 
86 #endif // BITCOIN_AVALANCHE_AVALANCHE_H
AVALANCHE_DEFAULT_PEER_REPLACEMENT_COOLDOWN
static constexpr size_t AVALANCHE_DEFAULT_PEER_REPLACEMENT_COOLDOWN
Peer replacement cooldown time default value in seconds.
Definition: avalanche.h:39
avalanche
Definition: avalanche.h:13
AVALANCHE_DEFAULT_COOLDOWN
static constexpr size_t AVALANCHE_DEFAULT_COOLDOWN
Avalanche default cooldown in milliseconds.
Definition: avalanche.h:49
AVALANCHE_DEFAULT_PEER_DISCOVERY_ENABLED
static constexpr bool AVALANCHE_DEFAULT_PEER_DISCOVERY_ENABLED
Is avalanche peer discovery enabled by default.
Definition: avalanche.h:27
avalanche::Processor
Definition: processor.h:96
AVALANCHE_DEFAULT_PROOF_REPLACEMENT_ENABLED
static constexpr bool AVALANCHE_DEFAULT_PROOF_REPLACEMENT_ENABLED
Is proof replacement enabled by default.
Definition: avalanche.h:44
g_avalanche
std::unique_ptr< avalanche::Processor > g_avalanche
Global avalanche instance.
Definition: processor.cpp:35
Amount::zero
static constexpr Amount zero()
Definition: amount.h:42
AVALANCHE_DEFAULT_MIN_QUORUM_CONNECTED_STAKE_RATIO
static constexpr double AVALANCHE_DEFAULT_MIN_QUORUM_CONNECTED_STAKE_RATIO
Default minimum percentage of stake-weighted peers we must have a node for to constitute a usable quo...
Definition: avalanche.h:68
AVALANCHE_DEFAULT_MIN_QUORUM_STAKE
static constexpr const Amount AVALANCHE_DEFAULT_MIN_QUORUM_STAKE
Default minimum cumulative stake of all known peers that constitutes a usable quorum.
Definition: avalanche.h:58
AVALANCHE_DEFAULT_ENABLED
static constexpr bool AVALANCHE_DEFAULT_ENABLED
Is avalanche enabled by default.
Definition: avalanche.h:22
AVALANCHE_DEFAULT_MIN_AVAPROOFS_NODE_COUNT
static constexpr double AVALANCHE_DEFAULT_MIN_AVAPROOFS_NODE_COUNT
Default minimum number of nodes that sent us an avaproofs message before we can consider our quorum s...
Definition: avalanche.h:77
Amount
Definition: amount.h:19
AVALANCHE_DEFAULT_CONFLICTING_PROOF_COOLDOWN
static constexpr size_t AVALANCHE_DEFAULT_CONFLICTING_PROOF_COOLDOWN
Conflicting proofs cooldown time default value in seconds.
Definition: avalanche.h:33
ArgsManager
Definition: system.h:147
amount.h
isAvalancheEnabled
bool isAvalancheEnabled(const ArgsManager &argsman)
Definition: avalanche.cpp:9