Bitcoin
|
#include <net.h>
Public Member Functions | |
SOCKET hSocket | GUARDED_BY (cs_hSocket) |
uint64_t nSendBytes | GUARDED_BY (cs_vSend) |
std::deque< std::vector< unsigned char > > vSendMsg | GUARDED_BY (cs_vSend) |
std::list< CNetMessage > vProcessMsg | GUARDED_BY (cs_vProcessMsg) |
uint64_t nRecvBytes | GUARDED_BY (cs_vRecv) |
std::string cleanSubVer | GUARDED_BY (cs_SubVer) |
bool fRelayTxes | GUARDED_BY (cs_filter) |
std::unique_ptr< CBloomFilter > pfilter | PT_GUARDED_BY (cs_filter) |
int64_t nNextAddrSend | GUARDED_BY (cs_sendProcessing) |
int64_t nNextLocalAddrSend | GUARDED_BY (cs_sendProcessing) |
CRollingBloomFilter filterInventoryKnown | GUARDED_BY (cs_inventory) |
std::vector< uint256 > vInventoryBlockToSend | GUARDED_BY (cs_inventory) |
std::vector< uint256 > vBlockHashesToAnnounce | GUARDED_BY (cs_inventory) |
bool fSendMempool | GUARDED_BY (cs_inventory) |
CAmount minFeeFilter | GUARDED_BY (cs_feeFilter) |
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 () | |
CNode (const CNode &)=delete | |
CNode & | operator= (const CNode &)=delete |
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... | |
CNode * | AddRef () |
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 | 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... | |
Protected Member Functions | |
mapMsgCmdSize mapRecvBytesPerMsgCmd | GUARDED_BY (cs_vRecv) |
Protected Attributes | |
mapMsgCmdSize | mapSendBytesPerMsgCmd |
Private Member Functions | |
std::string addrName | GUARDED_BY (cs_addrName) |
CService addrLocal | GUARDED_BY (cs_addrLocal) |
Private Attributes | |
const NodeId | id |
const uint64_t | nLocalHostNonce |
const ServiceFlags | nLocalServices |
const int | nMyStartingHeight |
int | nSendVersion {0} |
std::list< CNetMessage > | vRecvMsg |
CCriticalSection | cs_addrName |
CCriticalSection | cs_addrLocal |
Friends | |
class | CConnman |
Information about a peer
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 |
||
) |
CNode::~CNode | ( | ) |
|
delete |
|
inline |
|
inline |
|
inline |
void CNode::CloseSocketDisconnect | ( | ) |
void CNode::copyStats | ( | CNodeStats & | stats | ) |
CService CNode::GetAddrLocal | ( | ) | const |
std::string CNode::GetAddrName | ( | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
int CNode::GetSendVersion | ( | ) | const |
SOCKET hSocket CNode::GUARDED_BY | ( | cs_hSocket | ) |
std::deque<std::vector<unsigned char> > vSendMsg CNode::GUARDED_BY | ( | cs_vSend | ) |
std::list<CNetMessage> vProcessMsg CNode::GUARDED_BY | ( | cs_vProcessMsg | ) |
|
inline |
cleanSubVer is a sanitized string of the user agent byte array we read from the wire. This cleaned string can safely be logged or displayed.
|
inline |
|
protected |
|
inline |
|
inline |
CRollingBloomFilter filterInventoryKnown CNode::GUARDED_BY | ( | cs_inventory | ) |
std::vector<uint256> vInventoryBlockToSend CNode::GUARDED_BY | ( | cs_inventory | ) |
std::vector<uint256> vBlockHashesToAnnounce CNode::GUARDED_BY | ( | cs_inventory | ) |
|
inline |
|
inline |
|
private |
|
private |
void CNode::MaybeSetAddrName | ( | const std::string & | addrNameIn | ) |
Sets the addrName only if it was not previously set.
std::unique_ptr<CBloomFilter> pfilter CNode::PT_GUARDED_BY | ( | cs_filter | ) |
|
inline |
|
inline |
|
inline |
bool CNode::ReceiveMsgBytes | ( | const char * | pch, |
unsigned int | nBytes, | ||
bool & | complete | ||
) |
|
inline |
void CNode::SetAddrLocal | ( | const CService & | addrLocalIn | ) |
May not be called more than once.
|
inline |
void CNode::SetSendVersion | ( | int | nVersionIn | ) |
|
friend |
const CAddress CNode::addr |
const CAddress CNode::addrBind |
CRollingBloomFilter CNode::addrKnown |
|
mutableprivate |
|
mutableprivate |
CCriticalSection CNode::cs_feeFilter |
|
mutable |
CCriticalSection CNode::cs_hSocket |
CCriticalSection CNode::cs_inventory |
CCriticalSection CNode::cs_sendProcessing |
RecursiveMutex CNode::cs_SubVer |
CCriticalSection CNode::cs_vProcessMsg |
CCriticalSection CNode::cs_vRecv |
CCriticalSection CNode::cs_vSend |
bool CNode::fClient {false} |
std::atomic_bool CNode::fDisconnect {false} |
bool CNode::fFeeler {false} |
bool CNode::fGetAddr {false} |
const bool CNode::fInbound |
bool CNode::fOneShot {false} |
std::atomic_bool CNode::fPauseRecv {false} |
std::atomic_bool CNode::fPauseSend {false} |
std::atomic<bool> CNode::fPingQueued {false} |
bool CNode::fSentAddr {false} |
std::atomic_bool CNode::fSuccessfullyConnected {false} |
bool CNode::fWhitelisted {false} |
CSemaphoreGrant CNode::grantOutbound |
uint256 CNode::hashContinue |
|
private |
CAmount CNode::lastSentFeeFilter {0} |
bool CNode::m_limited_node {false} |
bool CNode::m_manual_connection {false} |
bool CNode::m_prefer_evict {false} |
|
protected |
int64_t CNode::nextSendTimeFeeFilter {0} |
const uint64_t CNode::nKeyedNetGroup |
std::atomic<int64_t> CNode::nLastBlockTime {0} |
std::atomic<int64_t> CNode::nLastRecv {0} |
std::atomic<int64_t> CNode::nLastSend {0} |
std::atomic<int64_t> CNode::nLastTXTime {0} |
|
private |
|
private |
|
private |
int64_t CNode::nNextInvSend {0} |
std::atomic<uint64_t> CNode::nPingNonceSent {0} |
std::atomic<int64_t> CNode::nPingUsecStart {0} |
std::atomic<int64_t> CNode::nPingUsecTime {0} |
size_t CNode::nProcessQueueSize {0} |
std::atomic<int> CNode::nRecvVersion {INIT_PROTO_VERSION} |
std::atomic<int> CNode::nRefCount {0} |
size_t CNode::nSendOffset {0} |
size_t CNode::nSendSize {0} |
|
private |
std::atomic<ServiceFlags> CNode::nServices {NODE_NONE} |
std::atomic<int> CNode::nStartingHeight {-1} |
const int64_t CNode::nTimeConnected |
std::atomic<int64_t> CNode::nTimeOffset {0} |
std::atomic<int> CNode::nVersion {0} |
std::set<uint256> CNode::orphan_work_set |
std::set<uint256> CNode::setInventoryTxToSend |
std::set<uint256> CNode::setKnown |
std::atomic<int64_t> CNode::timeLastMempoolReq {0} |
std::vector<CAddress> CNode::vAddrToSend |
std::deque<CInv> CNode::vRecvGetData |
|
private |