PbftSyncingState contains common members and functions related to syncing that are shared among multiple classes.
More...
#include <pbft_syncing_state.hpp>
PbftSyncingState contains common members and functions related to syncing that are shared among multiple classes.
◆ PbftSyncingState()
taraxa::network::tarcap::PbftSyncingState::PbftSyncingState |
( |
uint16_t |
deep_syncing_threshold | ) |
|
◆ isActivelySyncing()
bool taraxa::network::tarcap::PbftSyncingState::isActivelySyncing |
( |
| ) |
const |
Check if syncing is active.
- Returns
- true if last syncing packet was received within kSyncingInactivityThreshold
◆ isDeepPbftSyncing()
bool taraxa::network::tarcap::PbftSyncingState::isDeepPbftSyncing |
( |
| ) |
const |
Check if PBFT is in deep syncing.
- Returns
- true if PBFT is in deep syncing
◆ isPbftSyncing()
bool taraxa::network::tarcap::PbftSyncingState::isPbftSyncing |
( |
| ) |
|
Check if PBFT is in syncing. If not in active syncing, set PBFT syncing to false.
- Returns
- true if PBFT is in syncing
◆ setLastSyncPacketTime()
void taraxa::network::tarcap::PbftSyncingState::setLastSyncPacketTime |
( |
| ) |
|
Set current time as last received sync packet time.
◆ setPbftSyncing()
bool taraxa::network::tarcap::PbftSyncingState::setPbftSyncing |
( |
bool |
syncing, |
|
|
PbftPeriod |
current_period = 0 , |
|
|
std::shared_ptr< TaraxaPeer > |
peer = nullptr |
|
) |
| |
Set pbft syncing.
- Parameters
-
syncing | |
current_period | |
peer | used in case syncing flag == true to set which peer is the node syncing with |
◆ setSyncStatePeriod()
void taraxa::network::tarcap::PbftSyncingState::setSyncStatePeriod |
( |
PbftPeriod |
period | ) |
|
◆ syncingPeer()
std::shared_ptr< TaraxaPeer > taraxa::network::tarcap::PbftSyncingState::syncingPeer |
( |
| ) |
const |
Get the peer that our node is syncing with.
- Returns
- syncing peer, in case there is none - nullptr is returned
◆ deep_pbft_syncing_
std::atomic<bool> taraxa::network::tarcap::PbftSyncingState::deep_pbft_syncing_ {false} |
|
private |
◆ kDeepSyncingThreshold
const uint16_t taraxa::network::tarcap::PbftSyncingState::kDeepSyncingThreshold |
|
private |
◆ kSyncingInactivityThreshold
constexpr std::chrono::seconds taraxa::network::tarcap::PbftSyncingState::kSyncingInactivityThreshold {60} |
|
staticconstexprprivate |
◆ last_received_sync_packet_time_
std::chrono::steady_clock::time_point taraxa::network::tarcap::PbftSyncingState::last_received_sync_packet_time_ {std::chrono::steady_clock::now()} |
|
private |
◆ pbft_syncing_
std::atomic<bool> taraxa::network::tarcap::PbftSyncingState::pbft_syncing_ {false} |
|
private |
◆ peer_
std::shared_ptr<TaraxaPeer> taraxa::network::tarcap::PbftSyncingState::peer_ |
|
private |
◆ peer_mutex_
std::shared_mutex taraxa::network::tarcap::PbftSyncingState::peer_mutex_ |
|
mutableprivate |
◆ time_mutex_
std::shared_mutex taraxa::network::tarcap::PbftSyncingState::time_mutex_ |
|
mutableprivate |
The documentation for this class was generated from the following files: