![]() |
Dash Core
0.12.2.1
P2P Digital Currency
|
#include <net.h>
Public Member Functions | |
CNode (NodeId id, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn, SOCKET hSocketIn, const CAddress &addrIn, const std::string &addrNameIn="", bool fInboundIn=false, bool fNetworkNodeIn=false) | |
~CNode () | |
NodeId | GetId () const |
uint64_t | GetLocalNonce () const |
int | GetMyStartingHeight () const |
int | GetRefCount () |
bool | ReceiveMsgBytes (const char *pch, unsigned int nBytes, bool &complete) |
void | SetRecvVersion (int nVersionIn) |
int | GetRecvVersion () |
void | SetSendVersion (int nVersionIn) |
int | GetSendVersion () const |
CNode * | AddRef () |
void | Release () |
void | AddAddressKnown (const CAddress &addr) |
void | PushAddress (const CAddress &addr) |
void | AddInventoryKnown (const CInv &inv) |
void | PushInventory (const CInv &inv) |
void | PushBlockHash (const uint256 &hash) |
void | PushBlockHashFromINV (const uint256 &hash) |
void | AskFor (const CInv &inv) |
void | CloseSocketDisconnect () |
void | copyStats (CNodeStats &stats) |
ServiceFlags | GetLocalServices () const |
Static Public Member Functions | |
static std::vector< unsigned char > | CalculateKeyedNetGroup (CAddress &address) |
Protected Attributes | |
mapMsgCmdSize | mapSendBytesPerMsgCmd |
mapMsgCmdSize | mapRecvBytesPerMsgCmd |
Private Member Functions | |
CNode (const CNode &) | |
void | operator= (const CNode &) |
Private Attributes | |
CCriticalSection | cs_nRefCount |
uint64_t | nLocalHostNonce |
ServiceFlags | nLocalServices |
int | nMyStartingHeight |
int | nSendVersion |
std::list< CNetMessage > | vRecvMsg |
Static Private Attributes | |
static std::vector< unsigned char > | vchSecretKey |
Friends | |
class | CConnman |
CNode::CNode | ( | NodeId | id, |
ServiceFlags | nLocalServicesIn, | ||
int | nMyStartingHeightIn, | ||
SOCKET | hSocketIn, | ||
const CAddress & | addrIn, | ||
const std::string & | addrNameIn = "" , |
||
bool | fInboundIn = false , |
||
bool | fNetworkNodeIn = false |
||
) |
|
private |
|
inline |
Definition at line 838 of file net.h.
Referenced by ProcessMessage().
|
inline |
Definition at line 858 of file net.h.
Referenced by ProcessMessage().
|
inline |
Definition at line 822 of file net.h.
Referenced by CNode(), CConnman::ConnectNode(), and CConnman::CopyNodeVector().
void CNode::AskFor | ( | const CInv & | inv | ) |
Definition at line 2745 of file net.cpp.
Referenced by CGovernanceManager::ProcessMessage(), and ProcessMessage().
|
static |
void CNode::CloseSocketDisconnect | ( | ) |
Definition at line 462 of file net.cpp.
Referenced by CConnman::SetNetworkActive(), and CConnman::ThreadSocketHandler().
void CNode::copyStats | ( | CNodeStats & | stats | ) |
Definition at line 635 of file net.cpp.
Referenced by CConnman::GetNodeStats().
|
inline |
Definition at line 790 of file net.h.
Referenced by copyStats(), CConnman::DeleteNode(), CMasternodePaymentVote::IsValid(), ProcessGetData(), CMasternodeMan::ProcessMessage(), CMasternodePayments::ProcessMessage(), CGovernanceManager::ProcessMessage(), ProcessMessage(), CSporkManager::ProcessSpork(), ReceiveMsgBytes(), CGovernanceManager::RequestGovernanceObject(), and SendMessages().
|
inline |
Definition at line 794 of file net.h.
Referenced by CConnman::CheckIncomingNonce().
|
inline |
Definition at line 897 of file net.h.
Referenced by AdvertiseLocal(), and ProcessMessage().
|
inline |
Definition at line 815 of file net.h.
Referenced by ProcessMessages().
|
inline |
Definition at line 802 of file net.h.
Referenced by CConnman::ThreadSocketHandler().
int CNode::GetSendVersion | ( | ) | const |
Definition at line 742 of file net.cpp.
Referenced by CConnman::BeginMessage().
|
private |
|
inline |
Definition at line 843 of file net.h.
Referenced by AdvertiseLocal(), and ProcessMessage().
|
inline |
Definition at line 885 of file net.h.
Referenced by ProcessMessage().
|
inline |
Definition at line 866 of file net.h.
Referenced by CGovernanceManager::AddGovernanceObject(), CMasternodeMan::ProcessMessage(), ProcessMessage(), CConnman::RelayInv(), CConnman::RelayTransaction(), SendMessages(), CMasternodePayments::Sync(), and CGovernanceManager::Sync().
bool CNode::ReceiveMsgBytes | ( | const char * | pch, |
unsigned int | nBytes, | ||
bool & | complete | ||
) |
Definition at line 677 of file net.cpp.
Referenced by CConnman::ThreadSocketHandler().
|
inline |
Definition at line 829 of file net.h.
Referenced by CConnman::ReleaseNodeVector(), and CConnman::ThreadSocketHandler().
|
inline |
Definition at line 811 of file net.h.
Referenced by ProcessMessage().
void CNode::SetSendVersion | ( | int | nVersionIn | ) |
Definition at line 728 of file net.cpp.
Referenced by ProcessMessage().
CAddress CNode::addr |
Definition at line 688 of file net.h.
Referenced by AddAddressKnown(), AdvertiseLocal(), CMasternodeMan::AskForMN(), CConnman::Ban(), CMasternodeMan::CheckMnbAndUpdateMasternodeList(), CMasternodeSync::ClearFulfilledRequests(), CNode(), copyStats(), CConnman::DeleteNode(), CMasternodeMan::DsegUpdate(), CConnman::FindNode(), CConnman::ForNode(), IsPeerAddrLocalGood(), CActiveMasternode::ManageStateInitial(), CPrivateSendServer::ProcessMessage(), CPrivateSendClient::ProcessMessage(), CMasternodeMan::ProcessMessage(), CMasternodePayments::ProcessMessage(), CGovernanceManager::ProcessMessage(), ProcessMessage(), CMasternodeSync::ProcessTick(), CMasternodeMan::ProcessVerifyBroadcast(), CMasternodeMan::ProcessVerifyReply(), PushAddress(), CGovernanceManager::RequestGovernanceObjectVotes(), SendMessages(), CMasternodeMan::SendVerifyReply(), CMasternodeSync::SwitchToNextAsset(), CConnman::ThreadOpenConnections(), ThreadSendAlert(), and CConnman::ThreadSocketHandler().
CRollingBloomFilter CNode::addrKnown |
Definition at line 733 of file net.h.
Referenced by AddAddressKnown(), PushAddress(), and SendMessages().
CService CNode::addrLocal |
Definition at line 690 of file net.h.
Referenced by AdvertiseLocal(), copyStats(), IsPeerAddrLocalGood(), and ProcessMessage().
std::string CNode::addrName |
Definition at line 689 of file net.h.
Referenced by CGovernanceManager::AddGovernanceObject(), CNode(), CConnman::ConnectNode(), copyStats(), and CConnman::FindNode().
std::string CNode::cleanSubVer |
Definition at line 697 of file net.h.
Referenced by copyStats(), and ProcessMessage().
CCriticalSection CNode::cs_filter |
Definition at line 715 of file net.h.
Referenced by ProcessGetData(), ProcessMessage(), and CConnman::RelayTransaction().
CCriticalSection CNode::cs_inventory |
Definition at line 742 of file net.h.
Referenced by AddInventoryKnown(), PushBlockHash(), PushBlockHashFromINV(), PushInventory(), SendMessages(), and CConnman::ThreadSocketHandler().
|
private |
Definition at line 778 of file net.h.
Referenced by AddRef(), GetRefCount(), and Release().
CCriticalSection CNode::cs_vProcessMsg |
Definition at line 675 of file net.h.
Referenced by ProcessMessages(), and CConnman::ThreadSocketHandler().
CCriticalSection CNode::cs_vSend |
Definition at line 673 of file net.h.
Referenced by CConnman::PushMessage(), CConnman::ThreadMessageHandler(), and CConnman::ThreadSocketHandler().
bool CNode::fClient |
Definition at line 701 of file net.h.
Referenced by CNode(), ProcessMessage(), and SendMessages().
bool CNode::fDisconnect |
Definition at line 705 of file net.h.
Referenced by CConnman::AttemptToEvictConnection(), CConnman::Ban(), CloseSocketDisconnect(), CNode(), CConnman::NodeFullyConnected(), ProcessGetData(), ProcessMessage(), ProcessMessages(), CMasternodeSync::ProcessTick(), SendMessages(), CConnman::SocketSendData(), CConnman::ThreadMessageHandler(), CConnman::ThreadMnbRequestConnections(), and CConnman::ThreadSocketHandler().
bool CNode::fFeeler |
Definition at line 699 of file net.h.
Referenced by CNode(), CConnman::OpenNetworkConnection(), and ProcessMessage().
bool CNode::fGetAddr |
Definition at line 734 of file net.h.
Referenced by CNode(), and ProcessMessage().
CRollingBloomFilter CNode::filterInventoryKnown |
Definition at line 740 of file net.h.
Referenced by AddInventoryKnown(), CNode(), PushInventory(), and SendMessages().
bool CNode::fInbound |
Definition at line 702 of file net.h.
Referenced by CConnman::AcceptConnection(), CConnman::AttemptToEvictConnection(), CConnman::CheckIncomingNonce(), CNode(), copyStats(), ProcessMessage(), CMasternodeSync::ProcessTick(), CGovernanceManager::RequestGovernanceObjectVotes(), CConnman::ThreadOpenConnections(), and CConnman::ThreadSocketHandler().
bool CNode::fMasternode |
Definition at line 712 of file net.h.
Referenced by CNode(), CConnman::ConnectNode(), CMasternodeMan::ProcessMasternodeConnections(), CMasternodeSync::ProcessTick(), CGovernanceManager::RequestGovernanceObjectVotes(), CGovernanceManager::RequestOrphanObjects(), CConnman::ThreadOpenConnections(), and CConnman::ThreadSocketHandler().
bool CNode::fNetworkNode |
Definition at line 703 of file net.h.
Referenced by CNode(), ProcessMessage(), and CConnman::ThreadSocketHandler().
bool CNode::fOneShot |
Definition at line 700 of file net.h.
Referenced by CNode(), CConnman::OpenNetworkConnection(), ProcessMessage(), and SendMessages().
std::atomic_bool CNode::fPauseRecv |
Definition at line 720 of file net.h.
Referenced by CNode(), ProcessMessages(), and CConnman::ThreadSocketHandler().
std::atomic_bool CNode::fPauseSend |
Definition at line 721 of file net.h.
Referenced by CNode(), ProcessGetData(), ProcessMessages(), CConnman::PushMessage(), CConnman::SocketSendData(), and CConnman::ThreadMessageHandler().
bool CNode::fPingQueued |
Definition at line 767 of file net.h.
Referenced by CNode(), ping(), and SendMessages().
bool CNode::fRelayTxes |
Definition at line 710 of file net.h.
Referenced by CNode(), copyStats(), ProcessMessage(), and CConnman::RelayTransaction().
std::atomic_bool CNode::fSuccessfullyConnected |
Definition at line 704 of file net.h.
Referenced by AdvertiseLocal(), CConnman::CheckIncomingNonce(), CNode(), CConnman::NodeFullyConnected(), ProcessMessage(), and SendMessages().
bool CNode::fWhitelisted |
Definition at line 698 of file net.h.
Referenced by CConnman::AcceptConnection(), CConnman::AttemptToEvictConnection(), CNode(), copyStats(), ProcessGetData(), ProcessMessage(), and SendMessages().
CSemaphoreGrant CNode::grantMasternodeOutbound |
Definition at line 714 of file net.h.
Referenced by CConnman::ThreadMnbRequestConnections(), and CConnman::ThreadSocketHandler().
CSemaphoreGrant CNode::grantOutbound |
Definition at line 713 of file net.h.
Referenced by CConnman::OpenNetworkConnection(), and CConnman::ThreadSocketHandler().
uint256 CNode::hashContinue |
Definition at line 728 of file net.h.
Referenced by CNode(), ProcessGetData(), and ProcessMessage().
SOCKET CNode::hSocket |
Definition at line 668 of file net.h.
Referenced by CloseSocketDisconnect(), CNode(), CConnman::PushMessage(), CConnman::SocketSendData(), CConnman::Stop(), CConnman::ThreadSocketHandler(), and ~CNode().
NodeId CNode::id |
Definition at line 718 of file net.h.
Referenced by AskFor(), CConnman::AttemptToEvictConnection(), CConnman::ForNode(), GetId(), CMasternodeSync::ProcessMessage(), CMasternodeMan::ProcessMessage(), CMasternodePayments::ProcessMessage(), ProcessMessage(), ProcessMessages(), CSporkManager::ProcessSpork(), CMasternodeSync::ProcessTick(), CMasternodeMan::ProcessVerifyBroadcast(), CMasternodeMan::ProcessVerifyReply(), PushInventory(), CConnman::PushMessage(), CGovernanceManager::RequestGovernanceObject(), CMasternodePayments::RequestLowDataPaymentBlocks(), SendMessages(), CMasternodeMan::SendVerifyReply(), CMasternodePayments::Sync(), CGovernanceManager::Sync(), and CConnman::ThreadSocketHandler().
std::multimap<int64_t, CInv> CNode::mapAskFor |
Definition at line 744 of file net.h.
Referenced by AskFor(), and SendMessages().
|
protected |
Definition at line 725 of file net.h.
Referenced by CNode(), copyStats(), and ReceiveMsgBytes().
|
protected |
Definition at line 724 of file net.h.
Referenced by copyStats(), and CConnman::PushMessage().
std::atomic<int64_t> CNode::nLastBlockTime |
Definition at line 754 of file net.h.
Referenced by CNode(), and ProcessMessage().
int64_t CNode::nLastRecv |
Definition at line 684 of file net.h.
Referenced by CNode(), copyStats(), ReceiveMsgBytes(), and CConnman::ThreadSocketHandler().
int64_t CNode::nLastSend |
Definition at line 683 of file net.h.
Referenced by CNode(), copyStats(), CConnman::SocketSendData(), and CConnman::ThreadSocketHandler().
std::atomic<int64_t> CNode::nLastTXTime |
Definition at line 755 of file net.h.
Referenced by CNode(), and ProcessMessage().
int64_t CNode::nLastWarningTime |
|
private |
Definition at line 783 of file net.h.
Referenced by CNode(), and GetLocalNonce().
|
private |
Definition at line 784 of file net.h.
Referenced by CNode(), and GetLocalServices().
int64_t CNode::nMinPingUsecTime |
Definition at line 765 of file net.h.
Referenced by CNode(), copyStats(), and ProcessMessage().
|
private |
Definition at line 785 of file net.h.
Referenced by CNode(), and GetMyStartingHeight().
int64_t CNode::nNextAddrSend |
Definition at line 736 of file net.h.
Referenced by CNode(), and SendMessages().
int64_t CNode::nNextInvSend |
Definition at line 745 of file net.h.
Referenced by CNode(), and SendMessages().
int64_t CNode::nNextLocalAddrSend |
Definition at line 737 of file net.h.
Referenced by CNode(), and SendMessages().
int CNode::nNumWarningsSkipped |
uint64_t CNode::nPingNonceSent |
Definition at line 759 of file net.h.
Referenced by CNode(), copyStats(), ProcessMessage(), SendMessages(), and CConnman::ThreadSocketHandler().
int64_t CNode::nPingUsecStart |
Definition at line 761 of file net.h.
Referenced by CNode(), copyStats(), ProcessMessage(), SendMessages(), and CConnman::ThreadSocketHandler().
int64_t CNode::nPingUsecTime |
Definition at line 763 of file net.h.
Referenced by CNode(), copyStats(), and ProcessMessage().
size_t CNode::nProcessQueueSize |
Definition at line 677 of file net.h.
Referenced by CNode(), ProcessMessages(), and CConnman::ThreadSocketHandler().
uint64_t CNode::nRecvBytes |
Definition at line 680 of file net.h.
Referenced by CNode(), copyStats(), and ReceiveMsgBytes().
std::atomic<int> CNode::nRecvVersion |
Definition at line 681 of file net.h.
Referenced by CNode(), GetRecvVersion(), and SetRecvVersion().
int CNode::nRefCount |
uint64_t CNode::nSendBytes |
Definition at line 671 of file net.h.
Referenced by CNode(), copyStats(), and CConnman::SocketSendData().
size_t CNode::nSendOffset |
Definition at line 670 of file net.h.
Referenced by CNode(), and CConnman::SocketSendData().
size_t CNode::nSendSize |
Definition at line 669 of file net.h.
Referenced by CNode(), CConnman::PushMessage(), and CConnman::SocketSendData().
|
private |
Definition at line 786 of file net.h.
Referenced by GetSendVersion(), and SetSendVersion().
ServiceFlags CNode::nServices |
Definition at line 666 of file net.h.
Referenced by CNode(), copyStats(), and ProcessMessage().
ServiceFlags CNode::nServicesExpected |
Definition at line 667 of file net.h.
Referenced by CNode(), CConnman::ConnectNode(), and ProcessMessage().
int CNode::nStartingHeight |
Definition at line 729 of file net.h.
Referenced by CNode(), copyStats(), ProcessMessage(), SendMessages(), and PeerLogicValidation::UpdatedBlockTip().
int64_t CNode::nTimeConnected |
Definition at line 685 of file net.h.
Referenced by CNode(), CConnman::ConnectNode(), copyStats(), and CConnman::ThreadSocketHandler().
int64_t CNode::nTimeOffset |
Definition at line 686 of file net.h.
Referenced by CNode(), copyStats(), and ProcessMessage().
std::atomic<int> CNode::nVersion |
Definition at line 692 of file net.h.
Referenced by CNode(), copyStats(), CPrivateSendServer::ProcessMessage(), CInstantSend::ProcessMessage(), CPrivateSendClient::ProcessMessage(), CMasternodePayments::ProcessMessage(), CGovernanceManager::ProcessMessage(), ProcessMessage(), CMasternodeSync::ProcessTick(), CDarksendQueue::Relay(), RelayAddress(), CConnman::RelayInv(), CAlert::RelayTo(), CGovernanceManager::RequestGovernanceObject(), CGovernanceManager::RequestGovernanceObjectVotes(), CMasternodeSync::SendGovernanceSyncRequest(), SendMessages(), and CConnman::ThreadSocketHandler().
CBloomFilter* CNode::pfilter |
Definition at line 716 of file net.h.
Referenced by CNode(), ProcessGetData(), ProcessMessage(), CConnman::RelayTransaction(), and ~CNode().
std::set<uint256> CNode::setAskFor |
Definition at line 743 of file net.h.
Referenced by AskFor(), CInstantSend::ProcessMessage(), CMasternodeMan::ProcessMessage(), CMasternodePayments::ProcessMessage(), CGovernanceManager::ProcessMessage(), ProcessMessage(), CSporkManager::ProcessSpork(), CGovernanceManager::RequestGovernanceObjectVotes(), and SendMessages().
std::set<uint256> CNode::setKnown |
Definition at line 735 of file net.h.
Referenced by ProcessMessage(), and CAlert::RelayTo().
std::string CNode::strSubVer |
Definition at line 697 of file net.h.
Referenced by CNode(), ProcessMessage(), and CAlert::RelayTo().
std::vector<CAddress> CNode::vAddrToSend |
Definition at line 732 of file net.h.
Referenced by ProcessMessage(), PushAddress(), and SendMessages().
std::vector<uint256> CNode::vBlockHashesFromINV |
Definition at line 751 of file net.h.
Referenced by PushBlockHashFromINV(), and SendMessages().
std::vector<uint256> CNode::vBlockHashesToAnnounce |
Definition at line 748 of file net.h.
Referenced by PushBlockHash(), and SendMessages().
std::vector<unsigned char> CNode::vchKeyedNetGroup |
|
staticprivate |
Definition at line 776 of file net.h.
Referenced by CalculateKeyedNetGroup().
std::vector<CInv> CNode::vInventoryToSend |
Definition at line 741 of file net.h.
Referenced by PushInventory(), and SendMessages().
std::list<CNetMessage> CNode::vProcessMsg |
Definition at line 676 of file net.h.
Referenced by ProcessMessages(), and CConnman::ThreadSocketHandler().
std::deque<CInv> CNode::vRecvGetData |
Definition at line 679 of file net.h.
Referenced by ProcessGetData(), ProcessMessage(), and ProcessMessages().
|
private |
Definition at line 787 of file net.h.
Referenced by ReceiveMsgBytes(), and CConnman::ThreadSocketHandler().
std::deque<CSerializeData> CNode::vSendMsg |
Definition at line 672 of file net.h.
Referenced by CConnman::PushMessage(), CConnman::SocketSendData(), and CConnman::ThreadSocketHandler().