Changeset View
Changeset View
Standalone View
Standalone View
src/net.h
// Copyright (c) 2009-2010 Satoshi Nakamoto | // Copyright (c) 2009-2010 Satoshi Nakamoto | ||||
// Copyright (c) 2009-2019 The Bitcoin Core developers | // Copyright (c) 2009-2019 The Bitcoin Core developers | ||||
// Copyright (c) 2017-2019 The Bitcoin developers | // Copyright (c) 2017-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. | ||||
#ifndef BITCOIN_NET_H | #ifndef BITCOIN_NET_H | ||||
#define BITCOIN_NET_H | #define BITCOIN_NET_H | ||||
#include <addrdb.h> | #include <addrdb.h> | ||||
#include <addrman.h> | #include <addrman.h> | ||||
#include <amount.h> | #include <amount.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 <limitedmap.h> | #include <limitedmap.h> | ||||
#include <net_permissions.h> | #include <net_permissions.h> | ||||
#include <netaddress.h> | #include <netaddress.h> | ||||
▲ Show 20 Lines • Show All 972 Lines • ▼ Show 20 Lines | struct TxRelay { | ||||
Amount minFeeFilter GUARDED_BY(cs_feeFilter){Amount::zero()}; | Amount minFeeFilter GUARDED_BY(cs_feeFilter){Amount::zero()}; | ||||
Amount lastSentFeeFilter{Amount::zero()}; | Amount lastSentFeeFilter{Amount::zero()}; | ||||
int64_t nextSendTimeFeeFilter{0}; | int64_t nextSendTimeFeeFilter{0}; | ||||
}; | }; | ||||
// m_tx_relay == nullptr if we're not relaying transactions with this peer | // m_tx_relay == nullptr if we're not relaying transactions with this peer | ||||
std::unique_ptr<TxRelay> m_tx_relay; | std::unique_ptr<TxRelay> m_tx_relay; | ||||
struct AvalancheState { | |||||
AvalancheState() {} | |||||
avalanche::Delegation delegation; | |||||
}; | |||||
// m_avalanche_state == nullptr if we're not using avalanche with this peer | |||||
std::unique_ptr<AvalancheState> m_avalanche_state; | |||||
// Used for headers announcements - unfiltered blocks to relay | // Used for headers announcements - unfiltered blocks to relay | ||||
std::vector<BlockHash> vBlockHashesToAnnounce GUARDED_BY(cs_inventory); | std::vector<BlockHash> vBlockHashesToAnnounce GUARDED_BY(cs_inventory); | ||||
// Block and TXN accept times | // Block and TXN accept times | ||||
std::atomic<int64_t> nLastBlockTime{0}; | std::atomic<int64_t> nLastBlockTime{0}; | ||||
std::atomic<int64_t> nLastTXTime{0}; | std::atomic<int64_t> nLastTXTime{0}; | ||||
// Ping time measurement: | // Ping time measurement: | ||||
▲ Show 20 Lines • Show All 165 Lines • Show Last 20 Lines |