Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/avalanche.h
| // Copyright (c) 2021 The Bitcoin developers | // Copyright (c) 2021 The Bitcoin developers | ||||
| // Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
| // file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
| #ifndef BITCOIN_AVALANCHE_AVALANCHE_H | #ifndef BITCOIN_AVALANCHE_AVALANCHE_H | ||||
| #define BITCOIN_AVALANCHE_AVALANCHE_H | #define BITCOIN_AVALANCHE_AVALANCHE_H | ||||
| #include <cstddef> | #include <cstddef> | ||||
| #include <memory> | #include <memory> | ||||
| #include <amount.h> | |||||
| namespace avalanche { | namespace avalanche { | ||||
| class Processor; | class Processor; | ||||
| } | } | ||||
| class ArgsManager; | class ArgsManager; | ||||
| /** | /** | ||||
| * Is avalanche enabled by default. | * Is avalanche enabled by default. | ||||
| Show All 23 Lines | |||||
| static constexpr bool AVALANCHE_DEFAULT_PROOF_REPLACEMENT_ENABLED = false; | static constexpr bool AVALANCHE_DEFAULT_PROOF_REPLACEMENT_ENABLED = false; | ||||
| /** | /** | ||||
| * Avalanche default cooldown in milliseconds. | * Avalanche default cooldown in milliseconds. | ||||
| */ | */ | ||||
| static constexpr size_t AVALANCHE_DEFAULT_COOLDOWN = 100; | static constexpr size_t AVALANCHE_DEFAULT_COOLDOWN = 100; | ||||
| /** | /** | ||||
| * Default minimum cumulative stake of all known peers that constitutes a usable | |||||
| * quorum. | |||||
| * | |||||
| * FIXME: The default is set to 0 to allow existing tests to pass for now. We | |||||
| * need to set a sane default and update tests later. | |||||
| */ | |||||
| static constexpr const Amount AVALANCHE_DEFAULT_MIN_QUORUM_STAKE = | |||||
| Amount::zero(); | |||||
| /** | |||||
| * Default minimum percentage of stake-weighted peers we must have a node for to | |||||
| * constitute a usable quorum. | |||||
| * | |||||
| * FIXME: The default is set to 0 to allow existing tests to pass for now. We | |||||
| * need to set a sane default and update tests later. | |||||
| */ | |||||
| static constexpr double AVALANCHE_DEFAULT_MIN_QUORUM_CONNECTED_STAKE_RATIO = 0; | |||||
| /** | |||||
| * Global avalanche instance. | * Global avalanche instance. | ||||
| */ | */ | ||||
| extern std::unique_ptr<avalanche::Processor> g_avalanche; | extern std::unique_ptr<avalanche::Processor> g_avalanche; | ||||
| bool isAvalancheEnabled(const ArgsManager &argsman); | bool isAvalancheEnabled(const ArgsManager &argsman); | ||||
| #endif // BITCOIN_AVALANCHE_AVALANCHE_H | #endif // BITCOIN_AVALANCHE_AVALANCHE_H | ||||