Changeset View
Changeset View
Standalone View
Standalone View
src/avalanche/avalanche.cpp
// Copyright (c) 2018-2019 The Bitcoin developers | // Copyright (c) 2018-2019 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. | ||||
#include <avalanche/avalanche.h> | #include <avalanche/avalanche.h> | ||||
#include <chain.h> | #include <chain.h> | ||||
#include <netmessagemaker.h> | #include <netmessagemaker.h> | ||||
#include <reverse_iterator.h> | #include <reverse_iterator.h> | ||||
#include <scheduler.h> | #include <scheduler.h> | ||||
#include <util/bitmanip.h> | #include <util/bitmanip.h> | ||||
#include <validation.h> | #include <validation.h> | ||||
#include <chrono> | |||||
#include <tuple> | #include <tuple> | ||||
/** | /** | ||||
* Run the avalanche event loop every 10ms. | * Run the avalanche event loop every 10ms. | ||||
*/ | */ | ||||
static const int64_t AVALANCHE_TIME_STEP_MILLISECONDS = 10; | static const std::chrono::milliseconds AVALANCHE_TIME_STEP_MILLISECONDS{10}; | ||||
// Unfortunately, the bitcoind codebase is full of global and we are kinda | // Unfortunately, the bitcoind codebase is full of global and we are kinda | ||||
// forced into it here. | // forced into it here. | ||||
std::unique_ptr<AvalancheProcessor> g_avalanche; | std::unique_ptr<AvalancheProcessor> g_avalanche; | ||||
bool VoteRecord::registerVote(NodeId nodeid, uint32_t error) { | bool VoteRecord::registerVote(NodeId nodeid, uint32_t error) { | ||||
// We just got a new vote, so there is one less inflight request. | // We just got a new vote, so there is one less inflight request. | ||||
clearInflightRequest(); | clearInflightRequest(); | ||||
▲ Show 20 Lines • Show All 506 Lines • Show Last 20 Lines |