Changeset View
Changeset View
Standalone View
Standalone View
src/net.cpp
Show First 20 Lines • Show All 315 Lines • ▼ Show 20 Lines | CNode *CConnman::FindNode(const CService &addr) { | ||||
} | } | ||||
return nullptr; | return nullptr; | ||||
} | } | ||||
bool CConnman::CheckIncomingNonce(uint64_t nonce) { | bool CConnman::CheckIncomingNonce(uint64_t nonce) { | ||||
LOCK(cs_vNodes); | LOCK(cs_vNodes); | ||||
for (const CNode *pnode : vNodes) { | for (const CNode *pnode : vNodes) { | ||||
if (!pnode->fSuccessfullyConnected && !pnode->fInbound && | if (!pnode->fSuccessfullyConnected && !pnode->fInbound && | ||||
pnode->GetLocalNonce() == nonce) | pnode->GetLocalNonce() == nonce) { | ||||
return false; | return false; | ||||
} | } | ||||
} | |||||
return true; | return true; | ||||
} | } | ||||
/** Get the bind address for a socket as CAddress */ | /** Get the bind address for a socket as CAddress */ | ||||
static CAddress GetBindAddress(SOCKET sock) { | static CAddress GetBindAddress(SOCKET sock) { | ||||
CAddress addr_bind; | CAddress addr_bind; | ||||
struct sockaddr_storage sockaddr_bind; | struct sockaddr_storage sockaddr_bind; | ||||
socklen_t sockaddr_bind_len = sizeof(sockaddr_bind); | socklen_t sockaddr_bind_len = sizeof(sockaddr_bind); | ||||
▲ Show 20 Lines • Show All 2,507 Lines • Show Last 20 Lines |