Feathercoin  0.5.0
P2P Digital Currency
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | Static Protected Attributes | Private Member Functions | List of all members
CNode Class Reference

Information about a peer. More...

#include <net.h>

Collaboration diagram for CNode:
Collaboration graph
[legend]

Public Member Functions

 CNode (SOCKET hSocketIn, CAddress addrIn, std::string addrNameIn="", bool fInboundIn=false)
 
 ~CNode ()
 
int GetRefCount ()
 
unsigned int GetTotalRecvSize ()
 
bool ReceiveMsgBytes (const char *pch, unsigned int nBytes)
 
void SetRecvVersion (int nVersionIn)
 
CNodeAddRef ()
 
void Release ()
 
void AddAddressKnown (const CAddress &addr)
 
void PushAddress (const CAddress &addr)
 
void AddInventoryKnown (const CInv &inv)
 
void PushInventory (const CInv &inv)
 
void AskFor (const CInv &inv)
 
void BeginMessage (const char *pszCommand) EXCLUSIVE_LOCK_FUNCTION(cs_vSend)
 
void AbortMessage () UNLOCK_FUNCTION(cs_vSend)
 
void EndMessage () UNLOCK_FUNCTION(cs_vSend)
 
void PushVersion ()
 
void PushMessage (const char *pszCommand)
 
template<typename T1 >
void PushMessage (const char *pszCommand, const T1 &a1)
 
template<typename T1 , typename T2 >
void PushMessage (const char *pszCommand, const T1 &a1, const T2 &a2)
 
template<typename T1 , typename T2 , typename T3 >
void PushMessage (const char *pszCommand, const T1 &a1, const T2 &a2, const T3 &a3)
 
template<typename T1 , typename T2 , typename T3 , typename T4 >
void PushMessage (const char *pszCommand, const T1 &a1, const T2 &a2, const T3 &a3, const T4 &a4)
 
template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 >
void PushMessage (const char *pszCommand, const T1 &a1, const T2 &a2, const T3 &a3, const T4 &a4, const T5 &a5)
 
template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 >
void PushMessage (const char *pszCommand, const T1 &a1, const T2 &a2, const T3 &a3, const T4 &a4, const T5 &a5, const T6 &a6)
 
template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 >
void PushMessage (const char *pszCommand, const T1 &a1, const T2 &a2, const T3 &a3, const T4 &a4, const T5 &a5, const T6 &a6, const T7 &a7)
 
template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 >
void PushMessage (const char *pszCommand, const T1 &a1, const T2 &a2, const T3 &a3, const T4 &a4, const T5 &a5, const T6 &a6, const T7 &a7, const T8 &a8)
 
template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 >
void PushMessage (const char *pszCommand, const T1 &a1, const T2 &a2, const T3 &a3, const T4 &a4, const T5 &a5, const T6 &a6, const T7 &a7, const T8 &a8, const T9 &a9)
 
void PushGetBlocks (CBlockIndex *pindexBegin, uint256 hashEnd)
 
bool IsSubscribed (unsigned int nChannel)
 
void Subscribe (unsigned int nChannel, unsigned int nHops=0)
 
void CancelSubscribe (unsigned int nChannel)
 
void CloseSocketDisconnect ()
 
void Cleanup ()
 
bool Misbehaving (int howmuch)
 
void copyStats (CNodeStats &stats)
 

Static Public Member Functions

static void ClearBanned ()
 
static bool IsBanned (CNetAddr ip)
 

Public Attributes

uint64 nServices
 
SOCKET hSocket
 
CDataStream ssSend
 
size_t nSendSize
 
size_t nSendOffset
 
uint64 nSendBytes
 
std::deque< CSerializeDatavSendMsg
 
CCriticalSection cs_vSend
 
std::deque< CInvvRecvGetData
 
std::deque< CNetMessagevRecvMsg
 
CCriticalSection cs_vRecvMsg
 
uint64 nRecvBytes
 
int nRecvVersion
 
int64 nLastSend
 
int64 nLastRecv
 
int64 nLastSendEmpty
 
int64 nTimeConnected
 
uint64 nBlocksRequested
 
CAddress addr
 
std::string addrName
 
CService addrLocal
 
int nVersion
 
std::string strSubVer
 
std::string cleanSubVer
 
bool fOneShot
 
bool fClient
 
bool fInbound
 
bool fNetworkNode
 
bool fSuccessfullyConnected
 
bool fDisconnect
 
bool fRelayTxes
 
CSemaphoreGrant grantOutbound
 
CCriticalSection cs_filter
 
CBloomFilterpfilter
 
int nRefCount
 
uint256 hashContinue
 
CBlockIndexpindexLastGetBlocksBegin
 
uint256 hashLastGetBlocksEnd
 
int nStartingHeight
 
bool fStartSync
 
std::vector< CAddressvAddrToSend
 
std::set< CAddresssetAddrKnown
 
bool fGetAddr
 
std::set< uint256setKnown
 
uint256 hashCheckpointKnown
 
mruset< CInvsetInventoryKnown
 
std::vector< CInvvInventoryToSend
 
CCriticalSection cs_inventory
 
std::multimap< int64, CInvmapAskFor
 

Protected Attributes

int nMisbehavior
 

Static Protected Attributes

static std::map< CNetAddr, int64setBanned
 
static CCriticalSection cs_setBanned
 

Private Member Functions

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

Detailed Description

Information about a peer.

Definition at line 154 of file net.h.

Constructor & Destructor Documentation

CNode::CNode ( SOCKET  hSocketIn,
CAddress  addrIn,
std::string  addrNameIn = "",
bool  fInboundIn = false 
)
inline

Definition at line 230 of file net.h.

CNode::~CNode ( )
inline

Definition at line 272 of file net.h.

CNode::CNode ( const CNode )
private

Member Function Documentation

void CNode::AbortMessage ( )
inline

Definition at line 402 of file net.h.

void CNode::AddAddressKnown ( const CAddress addr)
inline

Definition at line 328 of file net.h.

void CNode::AddInventoryKnown ( const CInv inv)
inline

Definition at line 343 of file net.h.

CNode* CNode::AddRef ( )
inline

Definition at line 315 of file net.h.

void CNode::AskFor ( const CInv inv)
inline

Definition at line 360 of file net.h.

void CNode::BeginMessage ( const char *  pszCommand)
inline

Definition at line 392 of file net.h.

void CNode::CancelSubscribe ( unsigned int  nChannel)
void CNode::Cleanup ( )

Definition at line 535 of file net.cpp.

void CNode::ClearBanned ( )
static

Definition at line 559 of file net.cpp.

void CNode::CloseSocketDisconnect ( )

Definition at line 515 of file net.cpp.

void CNode::copyStats ( CNodeStats stats)

Definition at line 607 of file net.cpp.

void CNode::EndMessage ( )
inline

Definition at line 413 of file net.h.

int CNode::GetRefCount ( )
inline

Definition at line 289 of file net.h.

unsigned int CNode::GetTotalRecvSize ( )
inline

Definition at line 296 of file net.h.

bool CNode::IsBanned ( CNetAddr  ip)
static

Definition at line 564 of file net.cpp.

bool CNode::IsSubscribed ( unsigned int  nChannel)
bool CNode::Misbehaving ( int  howmuch)

Definition at line 580 of file net.cpp.

void CNode::operator= ( const CNode )
private
void CNode::PushAddress ( const CAddress addr)
inline

Definition at line 333 of file net.h.

void CNode::PushGetBlocks ( CBlockIndex pindexBegin,
uint256  hashEnd 
)

Definition at line 85 of file net.cpp.

void CNode::PushInventory ( const CInv inv)
inline

Definition at line 351 of file net.h.

void CNode::PushMessage ( const char *  pszCommand)
inline

Definition at line 454 of file net.h.

template<typename T1 >
void CNode::PushMessage ( const char *  pszCommand,
const T1 &  a1 
)
inline

Definition at line 469 of file net.h.

template<typename T1 , typename T2 >
void CNode::PushMessage ( const char *  pszCommand,
const T1 &  a1,
const T2 &  a2 
)
inline

Definition at line 485 of file net.h.

template<typename T1 , typename T2 , typename T3 >
void CNode::PushMessage ( const char *  pszCommand,
const T1 &  a1,
const T2 &  a2,
const T3 &  a3 
)
inline

Definition at line 501 of file net.h.

template<typename T1 , typename T2 , typename T3 , typename T4 >
void CNode::PushMessage ( const char *  pszCommand,
const T1 &  a1,
const T2 &  a2,
const T3 &  a3,
const T4 &  a4 
)
inline

Definition at line 517 of file net.h.

template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 >
void CNode::PushMessage ( const char *  pszCommand,
const T1 &  a1,
const T2 &  a2,
const T3 &  a3,
const T4 &  a4,
const T5 &  a5 
)
inline

Definition at line 533 of file net.h.

template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 >
void CNode::PushMessage ( const char *  pszCommand,
const T1 &  a1,
const T2 &  a2,
const T3 &  a3,
const T4 &  a4,
const T5 &  a5,
const T6 &  a6 
)
inline

Definition at line 549 of file net.h.

template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 >
void CNode::PushMessage ( const char *  pszCommand,
const T1 &  a1,
const T2 &  a2,
const T3 &  a3,
const T4 &  a4,
const T5 &  a5,
const T6 &  a6,
const T7 &  a7 
)
inline

Definition at line 565 of file net.h.

template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 >
void CNode::PushMessage ( const char *  pszCommand,
const T1 &  a1,
const T2 &  a2,
const T3 &  a3,
const T4 &  a4,
const T5 &  a5,
const T6 &  a6,
const T7 &  a7,
const T8 &  a8 
)
inline

Definition at line 581 of file net.h.

template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 >
void CNode::PushMessage ( const char *  pszCommand,
const T1 &  a1,
const T2 &  a2,
const T3 &  a3,
const T4 &  a4,
const T5 &  a5,
const T6 &  a6,
const T7 &  a7,
const T8 &  a8,
const T9 &  a9 
)
inline

Definition at line 597 of file net.h.

void CNode::PushVersion ( )

when NTP implemented, change to just nTime = GetAdjustedTime()

Definition at line 540 of file net.cpp.

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

Definition at line 627 of file net.cpp.

void CNode::Release ( )
inline

Definition at line 321 of file net.h.

void CNode::SetRecvVersion ( int  nVersionIn)
inline

Definition at line 308 of file net.h.

void CNode::Subscribe ( unsigned int  nChannel,
unsigned int  nHops = 0 
)

Member Data Documentation

CAddress CNode::addr

Definition at line 178 of file net.h.

CService CNode::addrLocal

Definition at line 180 of file net.h.

std::string CNode::addrName

Definition at line 179 of file net.h.

std::string CNode::cleanSubVer

Definition at line 186 of file net.h.

CCriticalSection CNode::cs_filter

Definition at line 199 of file net.h.

CCriticalSection CNode::cs_inventory

Definition at line 227 of file net.h.

CCriticalSection CNode::cs_setBanned
staticprotected

Definition at line 207 of file net.h.

CCriticalSection CNode::cs_vRecvMsg

Definition at line 169 of file net.h.

CCriticalSection CNode::cs_vSend

Definition at line 165 of file net.h.

bool CNode::fClient

Definition at line 188 of file net.h.

bool CNode::fDisconnect

Definition at line 192 of file net.h.

bool CNode::fGetAddr

Definition at line 220 of file net.h.

bool CNode::fInbound

Definition at line 189 of file net.h.

bool CNode::fNetworkNode

Definition at line 190 of file net.h.

bool CNode::fOneShot

Definition at line 187 of file net.h.

bool CNode::fRelayTxes

Definition at line 197 of file net.h.

bool CNode::fStartSync

Definition at line 215 of file net.h.

bool CNode::fSuccessfullyConnected

Definition at line 191 of file net.h.

CSemaphoreGrant CNode::grantOutbound

Definition at line 198 of file net.h.

uint256 CNode::hashCheckpointKnown

Definition at line 222 of file net.h.

uint256 CNode::hashContinue

Definition at line 211 of file net.h.

uint256 CNode::hashLastGetBlocksEnd

Definition at line 213 of file net.h.

SOCKET CNode::hSocket

Definition at line 159 of file net.h.

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

Definition at line 228 of file net.h.

uint64 CNode::nBlocksRequested

Definition at line 177 of file net.h.

int64 CNode::nLastRecv

Definition at line 174 of file net.h.

int64 CNode::nLastSend

Definition at line 173 of file net.h.

int64 CNode::nLastSendEmpty

Definition at line 175 of file net.h.

int CNode::nMisbehavior
protected

Definition at line 208 of file net.h.

uint64 CNode::nRecvBytes

Definition at line 170 of file net.h.

int CNode::nRecvVersion

Definition at line 171 of file net.h.

int CNode::nRefCount

Definition at line 201 of file net.h.

uint64 CNode::nSendBytes

Definition at line 163 of file net.h.

size_t CNode::nSendOffset

Definition at line 162 of file net.h.

size_t CNode::nSendSize

Definition at line 161 of file net.h.

uint64 CNode::nServices

Definition at line 158 of file net.h.

int CNode::nStartingHeight

Definition at line 214 of file net.h.

int64 CNode::nTimeConnected

Definition at line 176 of file net.h.

int CNode::nVersion

Definition at line 181 of file net.h.

CBloomFilter* CNode::pfilter

Definition at line 200 of file net.h.

CBlockIndex* CNode::pindexLastGetBlocksBegin

Definition at line 212 of file net.h.

std::set<CAddress> CNode::setAddrKnown

Definition at line 219 of file net.h.

std::map< CNetAddr, int64 > CNode::setBanned
staticprotected

Definition at line 206 of file net.h.

mruset<CInv> CNode::setInventoryKnown

Definition at line 225 of file net.h.

std::set<uint256> CNode::setKnown

Definition at line 221 of file net.h.

CDataStream CNode::ssSend

Definition at line 160 of file net.h.

std::string CNode::strSubVer

Definition at line 186 of file net.h.

std::vector<CAddress> CNode::vAddrToSend

Definition at line 218 of file net.h.

std::vector<CInv> CNode::vInventoryToSend

Definition at line 226 of file net.h.

std::deque<CInv> CNode::vRecvGetData

Definition at line 167 of file net.h.

std::deque<CNetMessage> CNode::vRecvMsg

Definition at line 168 of file net.h.

std::deque<CSerializeData> CNode::vSendMsg

Definition at line 164 of file net.h.


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