Changeset View
Changeset View
Standalone View
Standalone View
src/net.h
Show All 12 Lines | |||||
#include <avalanche/delegation.h> | #include <avalanche/delegation.h> | ||||
#include <bloom.h> | #include <bloom.h> | ||||
#include <chainparams.h> | #include <chainparams.h> | ||||
#include <compat.h> | #include <compat.h> | ||||
#include <crypto/siphash.h> | #include <crypto/siphash.h> | ||||
#include <hash.h> | #include <hash.h> | ||||
#include <net_permissions.h> | #include <net_permissions.h> | ||||
#include <netaddress.h> | #include <netaddress.h> | ||||
#include <nodeid.h> | |||||
#include <protocol.h> | #include <protocol.h> | ||||
#include <random.h> | #include <random.h> | ||||
#include <streams.h> | #include <streams.h> | ||||
#include <sync.h> | #include <sync.h> | ||||
#include <threadinterrupt.h> | #include <threadinterrupt.h> | ||||
#include <uint256.h> | #include <uint256.h> | ||||
#include <util/check.h> | #include <util/check.h> | ||||
#include <validation.h> // For cs_main | #include <validation.h> // For cs_main | ||||
▲ Show 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | |||||
/** | /** | ||||
* Pre-computed decay factor for the avalanche statistics computation. | * Pre-computed decay factor for the avalanche statistics computation. | ||||
* There is currently no constexpr variant of std::exp, so use a const. | * There is currently no constexpr variant of std::exp, so use a const. | ||||
*/ | */ | ||||
static const double AVALANCHE_STATISTICS_DECAY_FACTOR = | static const double AVALANCHE_STATISTICS_DECAY_FACTOR = | ||||
1. - std::exp(-1. * AVALANCHE_STATISTICS_REFRESH_PERIOD.count() / | 1. - std::exp(-1. * AVALANCHE_STATISTICS_REFRESH_PERIOD.count() / | ||||
AVALANCHE_STATISTICS_TIME_CONSTANT.count()); | AVALANCHE_STATISTICS_TIME_CONSTANT.count()); | ||||
typedef int64_t NodeId; | |||||
/** | |||||
* Special NodeId that represent no node. | |||||
*/ | |||||
static constexpr NodeId NO_NODE = -1; | |||||
struct AddedNodeInfo { | struct AddedNodeInfo { | ||||
std::string strAddedNode; | std::string strAddedNode; | ||||
CService resolvedAddress; | CService resolvedAddress; | ||||
bool fConnected; | bool fConnected; | ||||
bool fInbound; | bool fInbound; | ||||
}; | }; | ||||
struct CNodeStats; | struct CNodeStats; | ||||
▲ Show 20 Lines • Show All 1,204 Lines • Show Last 20 Lines |