Bitcoin
Classes | Public Member Functions | Public Attributes | List of all members
anonymous_namespace{net_processing.cpp}::CNodeState Struct Reference

Classes

struct  ChainSyncTimeoutState
 
struct  TxDownloadState
 

Public Member Functions

 CNodeState (CAddress addrIn, std::string addrNameIn, bool is_inbound, bool is_manual)
 

Public Attributes

const CService address
 The peer's address. More...
 
bool fCurrentlyConnected
 Whether we have a fully established connection. More...
 
int nMisbehavior
 Accumulated misbehaviour score for this peer. More...
 
bool fShouldBan
 Whether this peer should be disconnected and banned (unless whitelisted). More...
 
const std::string name
 String name of this peer (debugging/logging purposes). More...
 
std::vector< CBlockRejectrejects
 List of asynchronously-determined block rejections to notify this peer about. More...
 
const CBlockIndexpindexBestKnownBlock
 The best known block we know this peer has announced. More...
 
uint256 hashLastUnknownBlock
 The hash of the last unknown block this peer has announced. More...
 
const CBlockIndexpindexLastCommonBlock
 The last full block we both have. More...
 
const CBlockIndexpindexBestHeaderSent
 The best header we have sent our peer. More...
 
int nUnconnectingHeaders
 Length of current-streak of unconnecting headers announcements. More...
 
bool fSyncStarted
 Whether we've started headers synchronization with this peer. More...
 
int64_t nHeadersSyncTimeout
 When to potentially disconnect peer for stalling headers download. More...
 
int64_t nStallingSince
 Since when we're stalling block download progress (in microseconds), or 0. More...
 
std::list< QueuedBlockvBlocksInFlight
 
int64_t nDownloadingSince
 When the first entry in vBlocksInFlight started downloading. Don't care when vBlocksInFlight is empty. More...
 
int nBlocksInFlight
 
int nBlocksInFlightValidHeaders
 
bool fPreferredDownload
 Whether we consider this a preferred download peer. More...
 
bool fPreferHeaders
 Whether this peer wants invs or headers (when possible) for block announcements. More...
 
bool fPreferHeaderAndIDs
 Whether this peer wants invs or cmpctblocks (when possible) for block announcements. More...
 
bool fProvidesHeaderAndIDs
 
bool fHaveWitness
 Whether this peer can give us witnesses. More...
 
bool fWantsCmpctWitness
 Whether this peer wants witnesses in cmpctblocks/blocktxns. More...
 
bool fSupportsDesiredCmpctVersion
 
ChainSyncTimeoutState m_chain_sync
 
int64_t m_last_block_announcement
 Time of last new block announcement. More...
 
TxDownloadState m_tx_download
 
bool m_is_inbound
 Whether this peer is an inbound connection. More...
 
bool m_is_manual_connection
 Whether this peer is a manual connection. More...
 

Detailed Description

Maintain validation-specific state about nodes, protected by cs_main, instead by CNode's own locks. This simplifies asynchronous operation, where processing of incoming data is done after the ProcessMessage call returns, and we're no longer holding the node's locks.

Constructor & Destructor Documentation

◆ CNodeState()

anonymous_namespace{net_processing.cpp}::CNodeState::CNodeState ( CAddress  addrIn,
std::string  addrNameIn,
bool  is_inbound,
bool  is_manual 
)
inline

Member Data Documentation

◆ address

const CService anonymous_namespace{net_processing.cpp}::CNodeState::address

The peer's address.

◆ fCurrentlyConnected

bool anonymous_namespace{net_processing.cpp}::CNodeState::fCurrentlyConnected

Whether we have a fully established connection.

◆ fHaveWitness

bool anonymous_namespace{net_processing.cpp}::CNodeState::fHaveWitness

Whether this peer can give us witnesses.

◆ fPreferHeaderAndIDs

bool anonymous_namespace{net_processing.cpp}::CNodeState::fPreferHeaderAndIDs

Whether this peer wants invs or cmpctblocks (when possible) for block announcements.

◆ fPreferHeaders

bool anonymous_namespace{net_processing.cpp}::CNodeState::fPreferHeaders

Whether this peer wants invs or headers (when possible) for block announcements.

◆ fPreferredDownload

bool anonymous_namespace{net_processing.cpp}::CNodeState::fPreferredDownload

Whether we consider this a preferred download peer.

◆ fProvidesHeaderAndIDs

bool anonymous_namespace{net_processing.cpp}::CNodeState::fProvidesHeaderAndIDs

Whether this peer will send us cmpctblocks if we request them. This is not used to gate request logic, as we really only care about fSupportsDesiredCmpctVersion, but is used as a flag to "lock in" the version of compact blocks (fWantsCmpctWitness) we send.

◆ fShouldBan

bool anonymous_namespace{net_processing.cpp}::CNodeState::fShouldBan

Whether this peer should be disconnected and banned (unless whitelisted).

◆ fSupportsDesiredCmpctVersion

bool anonymous_namespace{net_processing.cpp}::CNodeState::fSupportsDesiredCmpctVersion

If we've announced NODE_WITNESS to this peer: whether the peer sends witnesses in cmpctblocks/blocktxns, otherwise: whether this peer sends non-witnesses in cmpctblocks/blocktxns.

◆ fSyncStarted

bool anonymous_namespace{net_processing.cpp}::CNodeState::fSyncStarted

Whether we've started headers synchronization with this peer.

◆ fWantsCmpctWitness

bool anonymous_namespace{net_processing.cpp}::CNodeState::fWantsCmpctWitness

Whether this peer wants witnesses in cmpctblocks/blocktxns.

◆ hashLastUnknownBlock

uint256 anonymous_namespace{net_processing.cpp}::CNodeState::hashLastUnknownBlock

The hash of the last unknown block this peer has announced.

◆ m_chain_sync

ChainSyncTimeoutState anonymous_namespace{net_processing.cpp}::CNodeState::m_chain_sync

◆ m_is_inbound

bool anonymous_namespace{net_processing.cpp}::CNodeState::m_is_inbound

Whether this peer is an inbound connection.

◆ m_is_manual_connection

bool anonymous_namespace{net_processing.cpp}::CNodeState::m_is_manual_connection

Whether this peer is a manual connection.

◆ m_last_block_announcement

int64_t anonymous_namespace{net_processing.cpp}::CNodeState::m_last_block_announcement

Time of last new block announcement.

◆ m_tx_download

TxDownloadState anonymous_namespace{net_processing.cpp}::CNodeState::m_tx_download

◆ name

const std::string anonymous_namespace{net_processing.cpp}::CNodeState::name

String name of this peer (debugging/logging purposes).

◆ nBlocksInFlight

int anonymous_namespace{net_processing.cpp}::CNodeState::nBlocksInFlight

◆ nBlocksInFlightValidHeaders

int anonymous_namespace{net_processing.cpp}::CNodeState::nBlocksInFlightValidHeaders

◆ nDownloadingSince

int64_t anonymous_namespace{net_processing.cpp}::CNodeState::nDownloadingSince

When the first entry in vBlocksInFlight started downloading. Don't care when vBlocksInFlight is empty.

◆ nHeadersSyncTimeout

int64_t anonymous_namespace{net_processing.cpp}::CNodeState::nHeadersSyncTimeout

When to potentially disconnect peer for stalling headers download.

◆ nMisbehavior

int anonymous_namespace{net_processing.cpp}::CNodeState::nMisbehavior

Accumulated misbehaviour score for this peer.

◆ nStallingSince

int64_t anonymous_namespace{net_processing.cpp}::CNodeState::nStallingSince

Since when we're stalling block download progress (in microseconds), or 0.

◆ nUnconnectingHeaders

int anonymous_namespace{net_processing.cpp}::CNodeState::nUnconnectingHeaders

Length of current-streak of unconnecting headers announcements.

◆ pindexBestHeaderSent

const CBlockIndex* anonymous_namespace{net_processing.cpp}::CNodeState::pindexBestHeaderSent

The best header we have sent our peer.

◆ pindexBestKnownBlock

const CBlockIndex* anonymous_namespace{net_processing.cpp}::CNodeState::pindexBestKnownBlock

The best known block we know this peer has announced.

◆ pindexLastCommonBlock

const CBlockIndex* anonymous_namespace{net_processing.cpp}::CNodeState::pindexLastCommonBlock

The last full block we both have.

◆ rejects

std::vector<CBlockReject> anonymous_namespace{net_processing.cpp}::CNodeState::rejects

List of asynchronously-determined block rejections to notify this peer about.

◆ vBlocksInFlight

std::list<QueuedBlock> anonymous_namespace{net_processing.cpp}::CNodeState::vBlocksInFlight

The documentation for this struct was generated from the following file: