Fabcoin Core  0.16.2
P2P Digital Currency
Public Member Functions | Public Attributes | Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
CNode Class Reference

Information about a peer. More...

#include <net.h>

Collaboration diagram for CNode:
[legend]

Public Member Functions

 CNode (NodeId id, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn, SOCKET hSocketIn, const CAddress &addrIn, uint64_t nKeyedNetGroupIn, uint64_t nLocalHostNonceIn, const CAddress &addrBindIn, const std::string &addrNameIn="", bool fInboundIn=false)
 
 ~CNode ()
 
NodeId GetId () const
 
uint64_t GetLocalNonce () const
 
int GetMyStartingHeight () const
 
int GetRefCount () const
 
bool ReceiveMsgBytes (const char *pch, unsigned int nBytes, bool &complete)
 
void SetRecvVersion (int nVersionIn)
 
int GetRecvVersion () const
 
void SetSendVersion (int nVersionIn)
 
int GetSendVersion () const
 
CService GetAddrLocal () const
 
void SetAddrLocal (const CService &addrLocalIn)
 May not be called more than once. More...
 
CNodeAddRef ()
 
void Release ()
 
void AddAddressKnown (const CAddress &_addr)
 
void PushAddress (const CAddress &_addr, FastRandomContext &insecure_rand)
 
void AddInventoryKnown (const CInv &inv)
 
void PushInventory (const CInv &inv)
 
void PushBlockHash (const uint256 &hash)
 
void AskFor (const CInv &inv)
 
void CloseSocketDisconnect ()
 
void copyStats (CNodeStats &stats)
 
ServiceFlags GetLocalServices () const
 
std::string GetAddrName () const
 
void MaybeSetAddrName (const std::string &addrNameIn)
 Sets the addrName only if it was not previously set. More...
 

Public Attributes

std::atomic< ServiceFlagsnServices
 
ServiceFlags nServicesExpected
 
SOCKET hSocket
 
size_t nSendSize
 
size_t nSendOffset
 
uint64_t nSendBytes
 
std::deque< std::vector< unsigned char > > vSendMsg
 
CCriticalSection cs_vSend
 
CCriticalSection cs_hSocket
 
CCriticalSection cs_vRecv
 
CCriticalSection cs_vProcessMsg
 
std::list< CNetMessagevProcessMsg
 
size_t nProcessQueueSize
 
CCriticalSection cs_sendProcessing
 
std::deque< CInvvRecvGetData
 
uint64_t nRecvBytes
 
std::atomic< int > nRecvVersion
 
std::atomic< int64_t > nLastSend
 
std::atomic< int64_t > nLastRecv
 
const int64_t nTimeConnected
 
std::atomic< int64_t > nTimeOffset
 
const CAddress addr
 
const CAddress addrBind
 
std::atomic< int > nVersion
 
std::string strSubVer
 
std::string cleanSubVer
 
CCriticalSection cs_SubVer
 
bool fWhitelisted
 
bool fFeeler
 
bool fOneShot
 
bool m_manual_connection
 
bool fClient
 
const bool fInbound
 
std::atomic_bool fSuccessfullyConnected
 
std::atomic_bool fDisconnect
 
bool fRelayTxes
 
bool fSentAddr
 
CSemaphoreGrant grantOutbound
 
CCriticalSection cs_filter
 
CBloomFilterpfilter
 
std::atomic< int > nRefCount
 
const uint64_t nKeyedNetGroup
 
std::atomic_bool fPauseRecv
 
std::atomic_bool fPauseSend
 
uint256 hashContinue
 
std::atomic< int > nStartingHeight
 
std::vector< CAddressvAddrToSend
 
CRollingBloomFilter addrKnown
 
bool fGetAddr
 
std::set< uint256setKnown
 
int64_t nNextAddrSend
 
int64_t nNextLocalAddrSend
 
CRollingBloomFilter filterInventoryKnown
 
std::set< uint256setInventoryTxToSend
 
std::vector< uint256vInventoryBlockToSend
 
CCriticalSection cs_inventory
 
std::set< uint256setAskFor
 
std::multimap< int64_t, CInvmapAskFor
 
int64_t nNextInvSend
 
std::vector< uint256vBlockHashesToAnnounce
 
bool fSendMempool
 
std::atomic< int64_t > timeLastMempoolReq
 
std::atomic< int64_t > nLastBlockTime
 
std::atomic< int64_t > nLastTXTime
 
std::atomic< uint64_t > nPingNonceSent
 
std::atomic< int64_t > nPingUsecStart
 
std::atomic< int64_t > nPingUsecTime
 
std::atomic< int64_t > nMinPingUsecTime
 
std::atomic< bool > fPingQueued
 
CAmount minFeeFilter
 
CCriticalSection cs_feeFilter
 
CAmount lastSentFeeFilter
 
int64_t nextSendTimeFeeFilter
 

Protected Attributes

mapMsgCmdSize mapSendBytesPerMsgCmd
 
mapMsgCmdSize mapRecvBytesPerMsgCmd
 

Private Member Functions

 CNode (const CNode &)
 
void operator= (const CNode &)
 

Private Attributes

const NodeId id
 
const uint64_t nLocalHostNonce
 
const ServiceFlags nLocalServices
 
const int nMyStartingHeight
 
int nSendVersion
 
std::list< CNetMessagevRecvMsg
 
CCriticalSection cs_addrName
 
std::string addrName
 
CService addrLocal
 
CCriticalSection cs_addrLocal
 

Friends

class CConnman
 

Detailed Description

Information about a peer.

Definition at line 599 of file net.h.

Constructor & Destructor Documentation

CNode::CNode ( NodeId  id,
ServiceFlags  nLocalServicesIn,
int  nMyStartingHeightIn,
SOCKET  hSocketIn,
const CAddress addrIn,
uint64_t  nKeyedNetGroupIn,
uint64_t  nLocalHostNonceIn,
const CAddress addrBindIn,
const std::string &  addrNameIn = "",
bool  fInboundIn = false 
)

Definition at line 2713 of file net.cpp.

Here is the call graph for this function:

CNode::~CNode ( )

Definition at line 2786 of file net.cpp.

Here is the call graph for this function:

CNode::CNode ( const CNode )
private

Member Function Documentation

void CNode::AddAddressKnown ( const CAddress _addr)
inline

Definition at line 794 of file net.h.

Here is the call graph for this function:

Here is the caller graph for this function:

void CNode::AddInventoryKnown ( const CInv inv)
inline

Definition at line 814 of file net.h.

Here is the call graph for this function:

Here is the caller graph for this function:

CNode* CNode::AddRef ( )
inline

Definition at line 781 of file net.h.

Here is the caller graph for this function:

void CNode::AskFor ( const CInv inv)

Definition at line 2794 of file net.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void CNode::CloseSocketDisconnect ( )

Definition at line 451 of file net.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void CNode::copyStats ( CNodeStats stats)

Definition at line 643 of file net.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

CService CNode::GetAddrLocal ( ) const

Definition at line 627 of file net.cpp.

Here is the caller graph for this function:

std::string CNode::GetAddrName ( ) const

Definition at line 615 of file net.cpp.

Here is the caller graph for this function:

NodeId CNode::GetId ( ) const
inline

Definition at line 746 of file net.h.

Here is the caller graph for this function:

uint64_t CNode::GetLocalNonce ( ) const
inline

Definition at line 750 of file net.h.

ServiceFlags CNode::GetLocalServices ( ) const
inline

Definition at line 846 of file net.h.

Here is the call graph for this function:

Here is the caller graph for this function:

int CNode::GetMyStartingHeight ( ) const
inline

Definition at line 754 of file net.h.

int CNode::GetRecvVersion ( ) const
inline

Definition at line 770 of file net.h.

Here is the caller graph for this function:

int CNode::GetRefCount ( ) const
inline

Definition at line 758 of file net.h.

Here is the call graph for this function:

int CNode::GetSendVersion ( ) const

Definition at line 767 of file net.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void CNode::MaybeSetAddrName ( const std::string &  addrNameIn)

Sets the addrName only if it was not previously set.

Definition at line 620 of file net.cpp.

Here is the caller graph for this function:

void CNode::operator= ( const CNode )
private
void CNode::PushAddress ( const CAddress _addr,
FastRandomContext insecure_rand 
)
inline

Definition at line 799 of file net.h.

Here is the call graph for this function:

Here is the caller graph for this function:

void CNode::PushBlockHash ( const uint256 hash)
inline

Definition at line 834 of file net.h.

void CNode::PushInventory ( const CInv inv)
inline

Definition at line 822 of file net.h.

Here is the call graph for this function:

Here is the caller graph for this function:

bool CNode::ReceiveMsgBytes ( const char *  pch,
unsigned int  nBytes,
bool &  complete 
)

Definition at line 700 of file net.cpp.

Here is the call graph for this function:

void CNode::Release ( )
inline

Definition at line 787 of file net.h.

void CNode::SetAddrLocal ( const CService addrLocalIn)

May not be called more than once.

Definition at line 632 of file net.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void CNode::SetRecvVersion ( int  nVersionIn)
inline

Definition at line 766 of file net.h.

Here is the caller graph for this function:

void CNode::SetSendVersion ( int  nVersionIn)

Definition at line 753 of file net.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Friends And Related Function Documentation

friend class CConnman
friend

Definition at line 601 of file net.h.

Member Data Documentation

const CAddress CNode::addr

Definition at line 630 of file net.h.

const CAddress CNode::addrBind

Definition at line 632 of file net.h.

CRollingBloomFilter CNode::addrKnown

Definition at line 673 of file net.h.

CService CNode::addrLocal
private

Definition at line 742 of file net.h.

std::string CNode::addrName
private

Definition at line 739 of file net.h.

std::string CNode::cleanSubVer

Definition at line 638 of file net.h.

CCriticalSection CNode::cs_addrLocal
mutableprivate

Definition at line 743 of file net.h.

CCriticalSection CNode::cs_addrName
mutableprivate

Definition at line 738 of file net.h.

CCriticalSection CNode::cs_feeFilter

Definition at line 718 of file net.h.

CCriticalSection CNode::cs_filter

Definition at line 655 of file net.h.

CCriticalSection CNode::cs_hSocket

Definition at line 612 of file net.h.

CCriticalSection CNode::cs_inventory

Definition at line 688 of file net.h.

CCriticalSection CNode::cs_sendProcessing

Definition at line 619 of file net.h.

CCriticalSection CNode::cs_SubVer

Definition at line 639 of file net.h.

CCriticalSection CNode::cs_vProcessMsg

Definition at line 615 of file net.h.

CCriticalSection CNode::cs_vRecv

Definition at line 613 of file net.h.

CCriticalSection CNode::cs_vSend

Definition at line 611 of file net.h.

bool CNode::fClient

Definition at line 644 of file net.h.

std::atomic_bool CNode::fDisconnect

Definition at line 647 of file net.h.

bool CNode::fFeeler

Definition at line 641 of file net.h.

bool CNode::fGetAddr

Definition at line 674 of file net.h.

CRollingBloomFilter CNode::filterInventoryKnown

Definition at line 680 of file net.h.

const bool CNode::fInbound

Definition at line 645 of file net.h.

bool CNode::fOneShot

Definition at line 642 of file net.h.

std::atomic_bool CNode::fPauseRecv

Definition at line 660 of file net.h.

std::atomic_bool CNode::fPauseSend

Definition at line 661 of file net.h.

std::atomic<bool> CNode::fPingQueued

Definition at line 715 of file net.h.

bool CNode::fRelayTxes

Definition at line 652 of file net.h.

bool CNode::fSendMempool

Definition at line 696 of file net.h.

bool CNode::fSentAddr

Definition at line 653 of file net.h.

std::atomic_bool CNode::fSuccessfullyConnected

Definition at line 646 of file net.h.

bool CNode::fWhitelisted

Definition at line 640 of file net.h.

CSemaphoreGrant CNode::grantOutbound

Definition at line 654 of file net.h.

uint256 CNode::hashContinue

Definition at line 668 of file net.h.

SOCKET CNode::hSocket

Definition at line 606 of file net.h.

const NodeId CNode::id
private

Definition at line 728 of file net.h.

CAmount CNode::lastSentFeeFilter

Definition at line 719 of file net.h.

bool CNode::m_manual_connection

Definition at line 643 of file net.h.

std::multimap<int64_t, CInv> CNode::mapAskFor

Definition at line 690 of file net.h.

mapMsgCmdSize CNode::mapRecvBytesPerMsgCmd
protected

Definition at line 665 of file net.h.

mapMsgCmdSize CNode::mapSendBytesPerMsgCmd
protected

Definition at line 664 of file net.h.

CAmount CNode::minFeeFilter

Definition at line 717 of file net.h.

int64_t CNode::nextSendTimeFeeFilter

Definition at line 720 of file net.h.

const uint64_t CNode::nKeyedNetGroup

Definition at line 659 of file net.h.

std::atomic<int64_t> CNode::nLastBlockTime

Definition at line 702 of file net.h.

std::atomic<int64_t> CNode::nLastRecv

Definition at line 626 of file net.h.

std::atomic<int64_t> CNode::nLastSend

Definition at line 625 of file net.h.

std::atomic<int64_t> CNode::nLastTXTime

Definition at line 703 of file net.h.

const uint64_t CNode::nLocalHostNonce
private

Definition at line 731 of file net.h.

const ServiceFlags CNode::nLocalServices
private

Definition at line 733 of file net.h.

std::atomic<int64_t> CNode::nMinPingUsecTime

Definition at line 713 of file net.h.

const int CNode::nMyStartingHeight
private

Definition at line 734 of file net.h.

int64_t CNode::nNextAddrSend

Definition at line 676 of file net.h.

int64_t CNode::nNextInvSend

Definition at line 691 of file net.h.

int64_t CNode::nNextLocalAddrSend

Definition at line 677 of file net.h.

std::atomic<uint64_t> CNode::nPingNonceSent

Definition at line 707 of file net.h.

std::atomic<int64_t> CNode::nPingUsecStart

Definition at line 709 of file net.h.

std::atomic<int64_t> CNode::nPingUsecTime

Definition at line 711 of file net.h.

size_t CNode::nProcessQueueSize

Definition at line 617 of file net.h.

uint64_t CNode::nRecvBytes

Definition at line 622 of file net.h.

std::atomic<int> CNode::nRecvVersion

Definition at line 623 of file net.h.

std::atomic<int> CNode::nRefCount

Definition at line 657 of file net.h.

uint64_t CNode::nSendBytes

Definition at line 609 of file net.h.

size_t CNode::nSendOffset

Definition at line 608 of file net.h.

size_t CNode::nSendSize

Definition at line 607 of file net.h.

int CNode::nSendVersion
private

Definition at line 735 of file net.h.

std::atomic<ServiceFlags> CNode::nServices

Definition at line 604 of file net.h.

ServiceFlags CNode::nServicesExpected

Definition at line 605 of file net.h.

std::atomic<int> CNode::nStartingHeight

Definition at line 669 of file net.h.

const int64_t CNode::nTimeConnected

Definition at line 627 of file net.h.

std::atomic<int64_t> CNode::nTimeOffset

Definition at line 628 of file net.h.

std::atomic<int> CNode::nVersion

Definition at line 633 of file net.h.

CBloomFilter* CNode::pfilter

Definition at line 656 of file net.h.

std::set<uint256> CNode::setAskFor

Definition at line 689 of file net.h.

std::set<uint256> CNode::setInventoryTxToSend

Definition at line 683 of file net.h.

std::set<uint256> CNode::setKnown

Definition at line 675 of file net.h.

std::string CNode::strSubVer

Definition at line 638 of file net.h.

std::atomic<int64_t> CNode::timeLastMempoolReq

Definition at line 699 of file net.h.

std::vector<CAddress> CNode::vAddrToSend

Definition at line 672 of file net.h.

std::vector<uint256> CNode::vBlockHashesToAnnounce

Definition at line 694 of file net.h.

std::vector<uint256> CNode::vInventoryBlockToSend

Definition at line 687 of file net.h.

std::list<CNetMessage> CNode::vProcessMsg

Definition at line 616 of file net.h.

std::deque<CInv> CNode::vRecvGetData

Definition at line 621 of file net.h.

std::list<CNetMessage> CNode::vRecvMsg
private

Definition at line 736 of file net.h.

std::deque<std::vector<unsigned char> > CNode::vSendMsg

Definition at line 610 of file net.h.


The documentation for this class was generated from the following files: