Bitcoin ABC  0.26.3
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 <consensus/amount.h>
12 
13 namespace avalanche {
14 class Processor;
15 }
16 
17 class ArgsManager;
18 
22 static constexpr bool AVALANCHE_DEFAULT_ENABLED = true;
23 
28 static constexpr size_t AVALANCHE_DEFAULT_CONFLICTING_PROOF_COOLDOWN = 60;
29 
35  24 * 60 * 60;
36 
40 static constexpr size_t AVALANCHE_DEFAULT_COOLDOWN = 100;
41 
47  int64_t(1'000'000'000'000) * SATOSHI; // 10B XEC
48 
54  0.8;
55 
60 static constexpr double AVALANCHE_DEFAULT_MIN_AVAPROOFS_NODE_COUNT = 8;
61 
63 static constexpr bool DEFAULT_PERSIST_AVAPEERS{true};
64 
66 static constexpr bool DEFAULT_AVALANCHE_PRECONSENSUS{false};
67 
71 extern std::unique_ptr<avalanche::Processor> g_avalanche;
72 
73 bool isAvalancheEnabled(const ArgsManager &argsman);
74 
75 #endif // BITCOIN_AVALANCHE_AVALANCHE_H
static constexpr Amount SATOSHI
Definition: amount.h:143
static constexpr bool DEFAULT_PERSIST_AVAPEERS
Default for -persistavapeers.
Definition: avalanche.h:63
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:53
bool isAvalancheEnabled(const ArgsManager &argsman)
Definition: avalanche.cpp:9
static constexpr size_t AVALANCHE_DEFAULT_PEER_REPLACEMENT_COOLDOWN
Peer replacement cooldown time default value in seconds.
Definition: avalanche.h:34
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:60
static constexpr bool DEFAULT_AVALANCHE_PRECONSENSUS
Default for -avalanchepreconsensus.
Definition: avalanche.h:66
static constexpr Amount AVALANCHE_DEFAULT_MIN_QUORUM_STAKE
Default minimum cumulative stake of all known peers that constitutes a usable quorum.
Definition: avalanche.h:46
static constexpr size_t AVALANCHE_DEFAULT_CONFLICTING_PROOF_COOLDOWN
Conflicting proofs cooldown time default value in seconds.
Definition: avalanche.h:28
static constexpr bool AVALANCHE_DEFAULT_ENABLED
Is avalanche enabled by default.
Definition: avalanche.h:22
std::unique_ptr< avalanche::Processor > g_avalanche
Global avalanche instance.
Definition: processor.cpp:38
static constexpr size_t AVALANCHE_DEFAULT_COOLDOWN
Avalanche default cooldown in milliseconds.
Definition: avalanche.h:40
Definition: amount.h:19